{"gameCode":"(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.stringifyServiceIdentifier = exports.LazyServiceIdentifier = void 0;\nconst stringifyServiceIdentifier_1 = require(\"./services/calculations/stringifyServiceIdentifier\");\nObject.defineProperty(exports, \"stringifyServiceIdentifier\", { enumerable: true, get: function () { return stringifyServiceIdentifier_1.stringifyServiceIdentifier; } });\nconst LazyServiceIdentifier_1 = require(\"./services/models/LazyServiceIdentifier\");\nObject.defineProperty(exports, \"LazyServiceIdentifier\", { enumerable: true, get: function () { return LazyServiceIdentifier_1.LazyServiceIdentifier; } });\n\n},{\"./services/calculations/stringifyServiceIdentifier\":2,\"./services/models/LazyServiceIdentifier\":3}],2:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.stringifyServiceIdentifier = stringifyServiceIdentifier;\nfunction stringifyServiceIdentifier(serviceIdentifier) {\n    switch (typeof serviceIdentifier) {\n        case 'string':\n        case 'symbol':\n            return serviceIdentifier.toString();\n        case 'function':\n            return serviceIdentifier.name;\n        default:\n            throw new Error(`Unexpected ${typeof serviceIdentifier} service id type`);\n    }\n}\n\n},{}],3:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LazyServiceIdentifier = exports.islazyServiceIdentifierSymbol = void 0;\nexports.islazyServiceIdentifierSymbol = Symbol.for('@inversifyjs/common/islazyServiceIdentifier');\nclass LazyServiceIdentifier {\n    [exports.islazyServiceIdentifierSymbol];\n    #buildServiceId;\n    constructor(buildServiceId) {\n        this.#buildServiceId = buildServiceId;\n        this[exports.islazyServiceIdentifierSymbol] = true;\n    }\n    static is(value) {\n        return (typeof value === 'object' &&\n            value !== null &&\n            value[exports.islazyServiceIdentifierSymbol] === true);\n    }\n    unwrap() {\n        return this.#buildServiceId();\n    }\n}\nexports.LazyServiceIdentifier = LazyServiceIdentifier;\n\n},{}],4:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InversifyCoreError = exports.isAppErrorSymbol = void 0;\nexports.isAppErrorSymbol = Symbol.for('@inversifyjs/core/InversifyCoreError');\nclass InversifyCoreError extends Error {\n    [exports.isAppErrorSymbol];\n    kind;\n    constructor(kind, message, options) {\n        super(message, options);\n        this[exports.isAppErrorSymbol] = true;\n        this.kind = kind;\n    }\n    static is(value) {\n        return (typeof value === 'object' &&\n            value !== null &&\n            value[exports.isAppErrorSymbol] === true);\n    }\n    static isErrorOfKind(value, kind) {\n        return InversifyCoreError.is(value) && value.kind === kind;\n    }\n}\nexports.InversifyCoreError = InversifyCoreError;\n\n},{}],5:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InversifyCoreErrorKind = void 0;\nvar InversifyCoreErrorKind;\n(function (InversifyCoreErrorKind) {\n    InversifyCoreErrorKind[InversifyCoreErrorKind[\"injectionDecoratorConflict\"] = 0] = \"injectionDecoratorConflict\";\n    InversifyCoreErrorKind[InversifyCoreErrorKind[\"missingInjectionDecorator\"] = 1] = \"missingInjectionDecorator\";\n    InversifyCoreErrorKind[InversifyCoreErrorKind[\"planning\"] = 2] = \"planning\";\n    InversifyCoreErrorKind[InversifyCoreErrorKind[\"unknown\"] = 3] = \"unknown\";\n})(InversifyCoreErrorKind || (exports.InversifyCoreErrorKind = InversifyCoreErrorKind = {}));\n\n},{}],6:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LegacyTargetImpl = exports.getTargets = exports.getClassMetadataFromMetadataReader = exports.getClassMetadata = exports.getClassElementMetadataFromLegacyMetadata = exports.ClassElementMetadataKind = void 0;\nconst getTargets_1 = require(\"./legacyTarget/calculations/getTargets\");\nObject.defineProperty(exports, \"getTargets\", { enumerable: true, get: function () { return getTargets_1.getTargets; } });\nconst LegacyTargetImpl_1 = require(\"./legacyTarget/models/LegacyTargetImpl\");\nObject.defineProperty(exports, \"LegacyTargetImpl\", { enumerable: true, get: function () { return LegacyTargetImpl_1.LegacyTargetImpl; } });\nconst getClassElementMetadataFromLegacyMetadata_1 = require(\"./metadata/calculations/getClassElementMetadataFromLegacyMetadata\");\nObject.defineProperty(exports, \"getClassElementMetadataFromLegacyMetadata\", { enumerable: true, get: function () { return getClassElementMetadataFromLegacyMetadata_1.getClassElementMetadataFromLegacyMetadata; } });\nconst getClassMetadata_1 = require(\"./metadata/calculations/getClassMetadata\");\nObject.defineProperty(exports, \"getClassMetadata\", { enumerable: true, get: function () { return getClassMetadata_1.getClassMetadata; } });\nconst getClassMetadataFromMetadataReader_1 = require(\"./metadata/calculations/getClassMetadataFromMetadataReader\");\nObject.defineProperty(exports, \"getClassMetadataFromMetadataReader\", { enumerable: true, get: function () { return getClassMetadataFromMetadataReader_1.getClassMetadataFromMetadataReader; } });\nconst ClassElementMetadataKind_1 = require(\"./metadata/models/ClassElementMetadataKind\");\nObject.defineProperty(exports, \"ClassElementMetadataKind\", { enumerable: true, get: function () { return ClassElementMetadataKind_1.ClassElementMetadataKind; } });\n\n},{\"./legacyTarget/calculations/getTargets\":8,\"./legacyTarget/models/LegacyTargetImpl\":10,\"./metadata/calculations/getClassElementMetadataFromLegacyMetadata\":12,\"./metadata/calculations/getClassMetadata\":14,\"./metadata/calculations/getClassMetadataFromMetadataReader\":17,\"./metadata/models/ClassElementMetadataKind\":23}],7:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getTargetId = getTargetId;\nconst reflect_metadata_utils_1 = require(\"@inversifyjs/reflect-metadata-utils\");\nconst ID_METADATA = '@inversifyjs/core/targetId';\nfunction getTargetId() {\n    const targetId = (0, reflect_metadata_utils_1.getReflectMetadata)(Object, ID_METADATA) ?? 0;\n    if (targetId === Number.MAX_SAFE_INTEGER) {\n        (0, reflect_metadata_utils_1.updateReflectMetadata)(Object, ID_METADATA, targetId, () => Number.MIN_SAFE_INTEGER);\n    }\n    else {\n        (0, reflect_metadata_utils_1.updateReflectMetadata)(Object, ID_METADATA, targetId, (id) => id + 1);\n    }\n    return targetId;\n}\n\n},{\"@inversifyjs/reflect-metadata-utils\":28}],8:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getTargets = void 0;\nconst getClassMetadata_1 = require(\"../../metadata/calculations/getClassMetadata\");\nconst getClassMetadataFromMetadataReader_1 = require(\"../../metadata/calculations/getClassMetadataFromMetadataReader\");\nconst getClassMetadataProperties_1 = require(\"../../metadata/calculations/getClassMetadataProperties\");\nconst getClassMetadataPropertiesFromMetadataReader_1 = require(\"../../metadata/calculations/getClassMetadataPropertiesFromMetadataReader\");\nconst getTargetsFromMetadataProviders_1 = require(\"./getTargetsFromMetadataProviders\");\nconst getTargets = (metadataReader) => {\n    const getClassMetadataFn = metadataReader === undefined\n        ? getClassMetadata_1.getClassMetadata\n        : (type) => (0, getClassMetadataFromMetadataReader_1.getClassMetadataFromMetadataReader)(type, metadataReader);\n    const getClassMetadataPropertiesFn = metadataReader === undefined\n        ? getClassMetadataProperties_1.getClassMetadataProperties\n        : (type) => (0, getClassMetadataPropertiesFromMetadataReader_1.getClassMetadataPropertiesFromMetadataReader)(type, metadataReader);\n    return (0, getTargetsFromMetadataProviders_1.getTargetsFromMetadataProviders)(getClassMetadataFn, getClassMetadataPropertiesFn);\n};\nexports.getTargets = getTargets;\n\n},{\"../../metadata/calculations/getClassMetadata\":14,\"../../metadata/calculations/getClassMetadataFromMetadataReader\":17,\"../../metadata/calculations/getClassMetadataProperties\":18,\"../../metadata/calculations/getClassMetadataPropertiesFromMetadataReader\":19,\"./getTargetsFromMetadataProviders\":9}],9:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getTargetsFromMetadataProviders = getTargetsFromMetadataProviders;\nconst ClassElementMetadataKind_1 = require(\"../../metadata/models/ClassElementMetadataKind\");\nconst getBaseType_1 = require(\"../../prototype/calculations/getBaseType\");\nconst LegacyTargetImpl_1 = require(\"../models/LegacyTargetImpl\");\nfunction getTargetsFromMetadataProviders(getClassMetadata, getClassMetadataProperties) {\n    return function getTagets(type) {\n        const classMetadata = getClassMetadata(type);\n        let baseType = (0, getBaseType_1.getBaseType)(type);\n        while (baseType !== undefined && baseType !== Object) {\n            const classMetadataProperties = getClassMetadataProperties(baseType);\n            for (const [propertyKey, propertyValue] of classMetadataProperties) {\n                if (!classMetadata.properties.has(propertyKey)) {\n                    classMetadata.properties.set(propertyKey, propertyValue);\n                }\n            }\n            baseType = (0, getBaseType_1.getBaseType)(baseType);\n        }\n        const targets = [];\n        for (const constructorArgument of classMetadata.constructorArguments) {\n            if (constructorArgument.kind !== ClassElementMetadataKind_1.ClassElementMetadataKind.unmanaged) {\n                const targetName = constructorArgument.targetName ?? '';\n                targets.push(new LegacyTargetImpl_1.LegacyTargetImpl(targetName, constructorArgument, 'ConstructorArgument'));\n            }\n        }\n        for (const [property, metadata] of classMetadata.properties) {\n            if (metadata.kind !== ClassElementMetadataKind_1.ClassElementMetadataKind.unmanaged) {\n                const targetName = metadata.targetName ?? property;\n                targets.push(new LegacyTargetImpl_1.LegacyTargetImpl(targetName, metadata, 'ClassProperty'));\n            }\n        }\n        return targets;\n    };\n}\n\n},{\"../../metadata/models/ClassElementMetadataKind\":23,\"../../prototype/calculations/getBaseType\":24,\"../models/LegacyTargetImpl\":10}],10:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LegacyTargetImpl = void 0;\nconst common_1 = require(\"@inversifyjs/common\");\nconst getLegacyMetadata_1 = require(\"../../metadata/calculations/getLegacyMetadata\");\nconst ClassElementMetadataKind_1 = require(\"../../metadata/models/ClassElementMetadataKind\");\nconst keys_1 = require(\"../../reflectMetadata/data/keys\");\nconst LegacyQueryableStringImpl_1 = require(\"../../string/models/LegacyQueryableStringImpl\");\nconst getDescription_1 = require(\"../../symbol/calculations/getDescription\");\nconst getTargetId_1 = require(\"../calculations/getTargetId\");\nclass LegacyTargetImpl {\n    #metadata;\n    #id;\n    #identifier;\n    #lazyLegacyMetadata;\n    #name;\n    #type;\n    constructor(identifier, metadata, type) {\n        this.#id = (0, getTargetId_1.getTargetId)();\n        this.#identifier = identifier;\n        this.#lazyLegacyMetadata = undefined;\n        this.#metadata = metadata;\n        this.#name = new LegacyQueryableStringImpl_1.LegacyQueryableStringImpl(typeof identifier === 'string' ? identifier : (0, getDescription_1.getDescription)(identifier));\n        this.#type = type;\n    }\n    get id() {\n        return this.#id;\n    }\n    /**\n     * If this is a class property target, this is the name of the property to be injected\n     */\n    get identifier() {\n        return this.#identifier;\n    }\n    get metadata() {\n        if (this.#lazyLegacyMetadata === undefined) {\n            this.#lazyLegacyMetadata = (0, getLegacyMetadata_1.getLegacyMetadata)(this.#metadata);\n        }\n        return this.#lazyLegacyMetadata;\n    }\n    get name() {\n        return this.#name;\n    }\n    get type() {\n        return this.#type;\n    }\n    get serviceIdentifier() {\n        if (common_1.LazyServiceIdentifier.is(this.#metadata.value)) {\n            return this.#metadata.value.unwrap();\n        }\n        else {\n            return this.#metadata.value;\n        }\n    }\n    getCustomTags() {\n        return [...this.#metadata.tags.entries()].map(([key, value]) => ({\n            key,\n            value,\n        }));\n    }\n    getNamedTag() {\n        return this.#metadata.name === undefined\n            ? null\n            : {\n                key: keys_1.NAMED_TAG,\n                value: this.#metadata.name,\n            };\n    }\n    hasTag(key) {\n        return this.metadata.some((metadata) => metadata.key === key);\n    }\n    isArray() {\n        return this.#metadata.kind === ClassElementMetadataKind_1.ClassElementMetadataKind.multipleInjection;\n    }\n    isNamed() {\n        return this.#metadata.name !== undefined;\n    }\n    isOptional() {\n        return this.#metadata.optional;\n    }\n    isTagged() {\n        return this.#metadata.tags.size > 0;\n    }\n    matchesArray(name) {\n        return this.isArray() && this.#metadata.value === name;\n    }\n    matchesNamedTag(name) {\n        return this.#metadata.name === name;\n    }\n    matchesTag(key) {\n        return (value) => this.metadata.some((metadata) => metadata.key === key && metadata.value === value);\n    }\n}\nexports.LegacyTargetImpl = LegacyTargetImpl;\n\n},{\"../../metadata/calculations/getLegacyMetadata\":21,\"../../metadata/models/ClassElementMetadataKind\":23,\"../../reflectMetadata/data/keys\":25,\"../../string/models/LegacyQueryableStringImpl\":26,\"../../symbol/calculations/getDescription\":27,\"../calculations/getTargetId\":7,\"@inversifyjs/common\":1}],11:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assertConstructorMetadataArrayFilled = assertConstructorMetadataArrayFilled;\nconst InversifyCoreError_1 = require(\"../../error/models/InversifyCoreError\");\nconst InversifyCoreErrorKind_1 = require(\"../../error/models/InversifyCoreErrorKind\");\nfunction assertConstructorMetadataArrayFilled(type, value) {\n    const undefinedIndexes = [];\n    // Using a for loop to ensure empty values are traversed as well\n    for (let i = 0; i < value.length; ++i) {\n        const element = value[i];\n        if (element === undefined) {\n            undefinedIndexes.push(i);\n        }\n    }\n    if (undefinedIndexes.length > 0) {\n        throw new InversifyCoreError_1.InversifyCoreError(InversifyCoreErrorKind_1.InversifyCoreErrorKind.missingInjectionDecorator, `Found unexpected missing metadata on type \"${type.name}\" at constructor indexes \"${undefinedIndexes.join('\", \"')}\".\n\nAre you using @inject, @multiInject or @unmanaged decorators at those indexes?\n\nIf you're using typescript and want to rely on auto injection, set \"emitDecoratorMetadata\" compiler option to true`);\n    }\n}\n\n},{\"../../error/models/InversifyCoreError\":4,\"../../error/models/InversifyCoreErrorKind\":5}],12:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getClassElementMetadataFromLegacyMetadata = getClassElementMetadataFromLegacyMetadata;\nconst InversifyCoreError_1 = require(\"../../error/models/InversifyCoreError\");\nconst InversifyCoreErrorKind_1 = require(\"../../error/models/InversifyCoreErrorKind\");\nconst keys_1 = require(\"../../reflectMetadata/data/keys\");\nconst ClassElementMetadataKind_1 = require(\"../models/ClassElementMetadataKind\");\nfunction getClassElementMetadataFromLegacyMetadata(metadataList) {\n    const injectMetadata = metadataList.find((metadata) => metadata.key === keys_1.INJECT_TAG);\n    const multiInjectMetadata = metadataList.find((metadata) => metadata.key === keys_1.MULTI_INJECT_TAG);\n    const unmanagedMetadata = metadataList.find((metadata) => metadata.key === keys_1.UNMANAGED_TAG);\n    if (unmanagedMetadata !== undefined) {\n        return getUnmanagedClassElementMetadata(injectMetadata, multiInjectMetadata);\n    }\n    if (multiInjectMetadata === undefined && injectMetadata === undefined) {\n        throw new InversifyCoreError_1.InversifyCoreError(InversifyCoreErrorKind_1.InversifyCoreErrorKind.missingInjectionDecorator, 'Expected @inject, @multiInject or @unmanaged metadata');\n    }\n    const nameMetadata = metadataList.find((metadata) => metadata.key === keys_1.NAMED_TAG);\n    const optionalMetadata = metadataList.find((metadata) => metadata.key === keys_1.OPTIONAL_TAG);\n    const targetNameMetadata = metadataList.find((metadata) => metadata.key === keys_1.NAME_TAG);\n    const managedClassElementMetadata = {\n        kind: injectMetadata === undefined\n            ? ClassElementMetadataKind_1.ClassElementMetadataKind.multipleInjection\n            : ClassElementMetadataKind_1.ClassElementMetadataKind.singleInjection,\n        name: nameMetadata?.value,\n        optional: optionalMetadata !== undefined,\n        tags: new Map(metadataList\n            .filter((metadata) => keys_1.NON_CUSTOM_TAG_KEYS.every((customTagKey) => metadata.key !== customTagKey))\n            .map((metadata) => [\n            metadata.key,\n            metadata.value,\n        ])),\n        targetName: targetNameMetadata?.value,\n        value: injectMetadata === undefined\n            ? multiInjectMetadata?.value\n            : injectMetadata.value,\n    };\n    return managedClassElementMetadata;\n}\nfunction getUnmanagedClassElementMetadata(injectMetadata, multiInjectMetadata) {\n    if (multiInjectMetadata !== undefined || injectMetadata !== undefined) {\n        throw new InversifyCoreError_1.InversifyCoreError(InversifyCoreErrorKind_1.InversifyCoreErrorKind.missingInjectionDecorator, 'Expected a single @inject, @multiInject or @unmanaged metadata');\n    }\n    return {\n        kind: ClassElementMetadataKind_1.ClassElementMetadataKind.unmanaged,\n    };\n}\n\n},{\"../../error/models/InversifyCoreError\":4,\"../../error/models/InversifyCoreErrorKind\":5,\"../../reflectMetadata/data/keys\":25,\"../models/ClassElementMetadataKind\":23}],13:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getClassElementMetadataFromNewable = getClassElementMetadataFromNewable;\nconst ClassElementMetadataKind_1 = require(\"../models/ClassElementMetadataKind\");\nfunction getClassElementMetadataFromNewable(type) {\n    return {\n        kind: ClassElementMetadataKind_1.ClassElementMetadataKind.singleInjection,\n        name: undefined,\n        optional: false,\n        tags: new Map(),\n        targetName: undefined,\n        value: type,\n    };\n}\n\n},{\"../models/ClassElementMetadataKind\":23}],14:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getClassMetadata = getClassMetadata;\nconst reflect_metadata_utils_1 = require(\"@inversifyjs/reflect-metadata-utils\");\nconst keys_1 = require(\"../../reflectMetadata/data/keys\");\nconst getClassMetadataConstructorArguments_1 = require(\"./getClassMetadataConstructorArguments\");\nconst getClassMetadataProperties_1 = require(\"./getClassMetadataProperties\");\nfunction getClassMetadata(type) {\n    const postConstructMetadata = (0, reflect_metadata_utils_1.getReflectMetadata)(type, keys_1.POST_CONSTRUCT);\n    const preDestroyMetadata = (0, reflect_metadata_utils_1.getReflectMetadata)(type, keys_1.PRE_DESTROY);\n    const classMetadata = {\n        constructorArguments: (0, getClassMetadataConstructorArguments_1.getClassMetadataConstructorArguments)(type),\n        lifecycle: {\n            postConstructMethodName: postConstructMetadata?.value,\n            preDestroyMethodName: preDestroyMetadata?.value,\n        },\n        properties: (0, getClassMetadataProperties_1.getClassMetadataProperties)(type),\n    };\n    return classMetadata;\n}\n\n},{\"../../reflectMetadata/data/keys\":25,\"./getClassMetadataConstructorArguments\":15,\"./getClassMetadataProperties\":18,\"@inversifyjs/reflect-metadata-utils\":28}],15:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getClassMetadataConstructorArguments = getClassMetadataConstructorArguments;\nconst reflect_metadata_utils_1 = require(\"@inversifyjs/reflect-metadata-utils\");\nconst keys_1 = require(\"../../reflectMetadata/data/keys\");\nconst assertConstructorMetadataArrayFilled_1 = require(\"./assertConstructorMetadataArrayFilled\");\nconst getClassElementMetadataFromNewable_1 = require(\"./getClassElementMetadataFromNewable\");\nconst getConstructorArgumentMetadataFromLegacyMetadata_1 = require(\"./getConstructorArgumentMetadataFromLegacyMetadata\");\nfunction getClassMetadataConstructorArguments(type) {\n    const typescriptMetadataList = (0, reflect_metadata_utils_1.getReflectMetadata)(type, keys_1.DESIGN_PARAM_TYPES);\n    const constructorParametersLegacyMetadata = (0, reflect_metadata_utils_1.getReflectMetadata)(type, keys_1.TAGGED);\n    const constructorArgumentsMetadata = [];\n    if (constructorParametersLegacyMetadata !== undefined) {\n        for (const [stringifiedIndex, metadataList] of Object.entries(constructorParametersLegacyMetadata)) {\n            const index = parseInt(stringifiedIndex);\n            constructorArgumentsMetadata[index] =\n                (0, getConstructorArgumentMetadataFromLegacyMetadata_1.getConstructorArgumentMetadataFromLegacyMetadata)(type, index, metadataList);\n        }\n    }\n    if (typescriptMetadataList !== undefined) {\n        for (let i = 0; i < typescriptMetadataList.length; ++i) {\n            if (constructorArgumentsMetadata[i] === undefined) {\n                const typescriptMetadata = typescriptMetadataList[i];\n                constructorArgumentsMetadata[i] =\n                    (0, getClassElementMetadataFromNewable_1.getClassElementMetadataFromNewable)(typescriptMetadata);\n            }\n        }\n    }\n    (0, assertConstructorMetadataArrayFilled_1.assertConstructorMetadataArrayFilled)(type, constructorArgumentsMetadata);\n    return constructorArgumentsMetadata;\n}\n\n},{\"../../reflectMetadata/data/keys\":25,\"./assertConstructorMetadataArrayFilled\":11,\"./getClassElementMetadataFromNewable\":13,\"./getConstructorArgumentMetadataFromLegacyMetadata\":20,\"@inversifyjs/reflect-metadata-utils\":28}],16:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getClassMetadataConstructorArgumentsFromMetadataReader = getClassMetadataConstructorArgumentsFromMetadataReader;\nconst assertConstructorMetadataArrayFilled_1 = require(\"./assertConstructorMetadataArrayFilled\");\nconst getClassElementMetadataFromNewable_1 = require(\"./getClassElementMetadataFromNewable\");\nconst getConstructorArgumentMetadataFromLegacyMetadata_1 = require(\"./getConstructorArgumentMetadataFromLegacyMetadata\");\nfunction getClassMetadataConstructorArgumentsFromMetadataReader(type, metadataReader) {\n    const legacyConstructorMetadata = metadataReader.getConstructorMetadata(type);\n    const constructorArgumentsMetadata = [];\n    for (const [stringifiedIndex, metadataList] of Object.entries(legacyConstructorMetadata.userGeneratedMetadata)) {\n        const index = parseInt(stringifiedIndex);\n        constructorArgumentsMetadata[index] =\n            (0, getConstructorArgumentMetadataFromLegacyMetadata_1.getConstructorArgumentMetadataFromLegacyMetadata)(type, index, metadataList);\n    }\n    if (legacyConstructorMetadata.compilerGeneratedMetadata !== undefined) {\n        for (let i = 0; i < legacyConstructorMetadata.compilerGeneratedMetadata.length; ++i) {\n            if (constructorArgumentsMetadata[i] === undefined) {\n                const typescriptMetadata = legacyConstructorMetadata\n                    .compilerGeneratedMetadata[i];\n                constructorArgumentsMetadata[i] =\n                    (0, getClassElementMetadataFromNewable_1.getClassElementMetadataFromNewable)(typescriptMetadata);\n            }\n        }\n    }\n    (0, assertConstructorMetadataArrayFilled_1.assertConstructorMetadataArrayFilled)(type, constructorArgumentsMetadata);\n    return constructorArgumentsMetadata;\n}\n\n},{\"./assertConstructorMetadataArrayFilled\":11,\"./getClassElementMetadataFromNewable\":13,\"./getConstructorArgumentMetadataFromLegacyMetadata\":20}],17:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getClassMetadataFromMetadataReader = getClassMetadataFromMetadataReader;\nconst reflect_metadata_utils_1 = require(\"@inversifyjs/reflect-metadata-utils\");\nconst keys_1 = require(\"../../reflectMetadata/data/keys\");\nconst getClassMetadataConstructorArgumentsFromMetadataReader_1 = require(\"./getClassMetadataConstructorArgumentsFromMetadataReader\");\nconst getClassMetadataPropertiesFromMetadataReader_1 = require(\"./getClassMetadataPropertiesFromMetadataReader\");\nfunction getClassMetadataFromMetadataReader(type, metadataReader) {\n    const postConstructMetadata = (0, reflect_metadata_utils_1.getReflectMetadata)(type, keys_1.POST_CONSTRUCT);\n    const preDestroyMetadata = (0, reflect_metadata_utils_1.getReflectMetadata)(type, keys_1.PRE_DESTROY);\n    const classMetadata = {\n        constructorArguments: (0, getClassMetadataConstructorArgumentsFromMetadataReader_1.getClassMetadataConstructorArgumentsFromMetadataReader)(type, metadataReader),\n        lifecycle: {\n            postConstructMethodName: postConstructMetadata?.value,\n            preDestroyMethodName: preDestroyMetadata?.value,\n        },\n        properties: (0, getClassMetadataPropertiesFromMetadataReader_1.getClassMetadataPropertiesFromMetadataReader)(type, metadataReader),\n    };\n    return classMetadata;\n}\n\n},{\"../../reflectMetadata/data/keys\":25,\"./getClassMetadataConstructorArgumentsFromMetadataReader\":16,\"./getClassMetadataPropertiesFromMetadataReader\":19,\"@inversifyjs/reflect-metadata-utils\":28}],18:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getClassMetadataProperties = getClassMetadataProperties;\nconst reflect_metadata_utils_1 = require(\"@inversifyjs/reflect-metadata-utils\");\nconst keys_1 = require(\"../../reflectMetadata/data/keys\");\nconst getPropertyMetadataFromLegacyMetadata_1 = require(\"./getPropertyMetadataFromLegacyMetadata\");\nfunction getClassMetadataProperties(type) {\n    const propertiesLegacyMetadata = (0, reflect_metadata_utils_1.getReflectMetadata)(type, keys_1.TAGGED_PROP);\n    const propertiesMetadata = new Map();\n    if (propertiesLegacyMetadata !== undefined) {\n        for (const property of Reflect.ownKeys(propertiesLegacyMetadata)) {\n            const legacyMetadata = propertiesLegacyMetadata[property];\n            propertiesMetadata.set(property, (0, getPropertyMetadataFromLegacyMetadata_1.getPropertyMetadataFromLegacyMetadata)(type, property, legacyMetadata));\n        }\n    }\n    return propertiesMetadata;\n}\n\n},{\"../../reflectMetadata/data/keys\":25,\"./getPropertyMetadataFromLegacyMetadata\":22,\"@inversifyjs/reflect-metadata-utils\":28}],19:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getClassMetadataPropertiesFromMetadataReader = getClassMetadataPropertiesFromMetadataReader;\nconst getPropertyMetadataFromLegacyMetadata_1 = require(\"./getPropertyMetadataFromLegacyMetadata\");\nfunction getClassMetadataPropertiesFromMetadataReader(type, metadataReader) {\n    const propertiesLegacyMetadata = metadataReader.getPropertiesMetadata(type);\n    const propertiesMetadata = new Map();\n    for (const property of Reflect.ownKeys(propertiesLegacyMetadata)) {\n        const legacyMetadata = propertiesLegacyMetadata[property];\n        propertiesMetadata.set(property, (0, getPropertyMetadataFromLegacyMetadata_1.getPropertyMetadataFromLegacyMetadata)(type, property, legacyMetadata));\n    }\n    return propertiesMetadata;\n}\n\n},{\"./getPropertyMetadataFromLegacyMetadata\":22}],20:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getConstructorArgumentMetadataFromLegacyMetadata = getConstructorArgumentMetadataFromLegacyMetadata;\nconst InversifyCoreError_1 = require(\"../../error/models/InversifyCoreError\");\nconst InversifyCoreErrorKind_1 = require(\"../../error/models/InversifyCoreErrorKind\");\nconst getClassElementMetadataFromLegacyMetadata_1 = require(\"./getClassElementMetadataFromLegacyMetadata\");\nfunction getConstructorArgumentMetadataFromLegacyMetadata(type, index, metadataList) {\n    try {\n        return (0, getClassElementMetadataFromLegacyMetadata_1.getClassElementMetadataFromLegacyMetadata)(metadataList);\n    }\n    catch (error) {\n        if (InversifyCoreError_1.InversifyCoreError.isErrorOfKind(error, InversifyCoreErrorKind_1.InversifyCoreErrorKind.missingInjectionDecorator)) {\n            throw new InversifyCoreError_1.InversifyCoreError(InversifyCoreErrorKind_1.InversifyCoreErrorKind.missingInjectionDecorator, `Expected a single @inject, @multiInject or @unmanaged decorator at type \"${type.name}\" at constructor arguments at index \"${index.toString()}\"`, { cause: error });\n        }\n        else {\n            throw error;\n        }\n    }\n}\n\n},{\"../../error/models/InversifyCoreError\":4,\"../../error/models/InversifyCoreErrorKind\":5,\"./getClassElementMetadataFromLegacyMetadata\":12}],21:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getLegacyMetadata = getLegacyMetadata;\nconst keys_1 = require(\"../../reflectMetadata/data/keys\");\nconst ClassElementMetadataKind_1 = require(\"../models/ClassElementMetadataKind\");\nfunction getLegacyMetadata(classElementMetadata) {\n    switch (classElementMetadata.kind) {\n        case ClassElementMetadataKind_1.ClassElementMetadataKind.unmanaged:\n            return getUnmanagedLegacyMetadata();\n        default:\n            return getManagedLegacyMetadata(classElementMetadata);\n    }\n}\nfunction getManagedLegacyMetadata(classElementMetadata) {\n    const legacyMetadataList = [\n        getManagedKindLegacyMetadata(classElementMetadata),\n    ];\n    if (classElementMetadata.name !== undefined) {\n        legacyMetadataList.push({\n            key: keys_1.NAMED_TAG,\n            value: classElementMetadata.name,\n        });\n    }\n    if (classElementMetadata.optional) {\n        legacyMetadataList.push({\n            key: keys_1.OPTIONAL_TAG,\n            value: true,\n        });\n    }\n    for (const [tagKey, tagValue] of classElementMetadata.tags) {\n        legacyMetadataList.push({\n            key: tagKey,\n            value: tagValue,\n        });\n    }\n    if (classElementMetadata.targetName !== undefined) {\n        legacyMetadataList.push({\n            key: keys_1.NAME_TAG,\n            value: classElementMetadata.targetName,\n        });\n    }\n    return legacyMetadataList;\n}\nfunction getManagedKindLegacyMetadata(classElementMetadata) {\n    let kindLegacyMetadata;\n    switch (classElementMetadata.kind) {\n        case ClassElementMetadataKind_1.ClassElementMetadataKind.multipleInjection:\n            kindLegacyMetadata = {\n                key: keys_1.MULTI_INJECT_TAG,\n                value: classElementMetadata.value,\n            };\n            break;\n        case ClassElementMetadataKind_1.ClassElementMetadataKind.singleInjection:\n            kindLegacyMetadata = {\n                key: keys_1.INJECT_TAG,\n                value: classElementMetadata.value,\n            };\n            break;\n    }\n    return kindLegacyMetadata;\n}\nfunction getUnmanagedLegacyMetadata() {\n    return [\n        {\n            key: keys_1.UNMANAGED_TAG,\n            value: true,\n        },\n    ];\n}\n\n},{\"../../reflectMetadata/data/keys\":25,\"../models/ClassElementMetadataKind\":23}],22:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getPropertyMetadataFromLegacyMetadata = getPropertyMetadataFromLegacyMetadata;\nconst InversifyCoreError_1 = require(\"../../error/models/InversifyCoreError\");\nconst InversifyCoreErrorKind_1 = require(\"../../error/models/InversifyCoreErrorKind\");\nconst getClassElementMetadataFromLegacyMetadata_1 = require(\"./getClassElementMetadataFromLegacyMetadata\");\nfunction getPropertyMetadataFromLegacyMetadata(type, key, metadataList) {\n    try {\n        return (0, getClassElementMetadataFromLegacyMetadata_1.getClassElementMetadataFromLegacyMetadata)(metadataList);\n    }\n    catch (error) {\n        if (InversifyCoreError_1.InversifyCoreError.isErrorOfKind(error, InversifyCoreErrorKind_1.InversifyCoreErrorKind.missingInjectionDecorator)) {\n            throw new InversifyCoreError_1.InversifyCoreError(InversifyCoreErrorKind_1.InversifyCoreErrorKind.missingInjectionDecorator, `Expected a single @inject, @multiInject or @unmanaged decorator at type \"${type.name}\" at property \"${key.toString()}\"`, { cause: error });\n        }\n        else {\n            throw error;\n        }\n    }\n}\n\n},{\"../../error/models/InversifyCoreError\":4,\"../../error/models/InversifyCoreErrorKind\":5,\"./getClassElementMetadataFromLegacyMetadata\":12}],23:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ClassElementMetadataKind = void 0;\nvar ClassElementMetadataKind;\n(function (ClassElementMetadataKind) {\n    ClassElementMetadataKind[ClassElementMetadataKind[\"multipleInjection\"] = 0] = \"multipleInjection\";\n    ClassElementMetadataKind[ClassElementMetadataKind[\"singleInjection\"] = 1] = \"singleInjection\";\n    ClassElementMetadataKind[ClassElementMetadataKind[\"unmanaged\"] = 2] = \"unmanaged\";\n})(ClassElementMetadataKind || (exports.ClassElementMetadataKind = ClassElementMetadataKind = {}));\n\n},{}],24:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getBaseType = getBaseType;\nfunction getBaseType(type) {\n    const prototype = Object.getPrototypeOf(type.prototype);\n    const baseType = prototype?.constructor;\n    return baseType;\n}\n\n},{}],25:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NON_CUSTOM_TAG_KEYS = exports.PRE_DESTROY = exports.POST_CONSTRUCT = exports.DESIGN_PARAM_TYPES = exports.PARAM_TYPES = exports.TAGGED_PROP = exports.TAGGED = exports.MULTI_INJECT_TAG = exports.INJECT_TAG = exports.OPTIONAL_TAG = exports.UNMANAGED_TAG = exports.NAME_TAG = exports.NAMED_TAG = void 0;\n// Used for named bindings\nexports.NAMED_TAG = 'named';\nexports.NAME_TAG = 'name';\n// The for unmanaged injections (in base classes when using inheritance)\nexports.UNMANAGED_TAG = 'unmanaged';\n// The for optional injections\nexports.OPTIONAL_TAG = 'optional';\n// The type of the binding at design time\nexports.INJECT_TAG = 'inject';\n// The type of the binding at design type for multi-injections\nexports.MULTI_INJECT_TAG = 'multi_inject';\n// used to store constructor arguments tags\nexports.TAGGED = 'inversify:tagged';\n// used to store class properties tags\nexports.TAGGED_PROP = 'inversify:tagged_props';\n// used to store types to be injected\nexports.PARAM_TYPES = 'inversify:paramtypes';\n// used to access design time types\nexports.DESIGN_PARAM_TYPES = 'design:paramtypes';\n// used to identify postConstruct functions\nexports.POST_CONSTRUCT = 'post_construct';\n// used to identify preDestroy functions\nexports.PRE_DESTROY = 'pre_destroy';\nfunction getNonCustomTagKeys() {\n    return [\n        exports.INJECT_TAG,\n        exports.MULTI_INJECT_TAG,\n        exports.NAME_TAG,\n        exports.UNMANAGED_TAG,\n        exports.NAMED_TAG,\n        exports.OPTIONAL_TAG,\n    ];\n}\nexports.NON_CUSTOM_TAG_KEYS = getNonCustomTagKeys();\n\n},{}],26:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LegacyQueryableStringImpl = void 0;\nclass LegacyQueryableStringImpl {\n    #str;\n    constructor(str) {\n        this.#str = str;\n    }\n    startsWith(searchString) {\n        return this.#str.startsWith(searchString);\n    }\n    endsWith(searchString) {\n        return this.#str.endsWith(searchString);\n    }\n    contains(searchString) {\n        return this.#str.includes(searchString);\n    }\n    equals(compareString) {\n        return this.#str === compareString;\n    }\n    value() {\n        return this.#str;\n    }\n}\nexports.LegacyQueryableStringImpl = LegacyQueryableStringImpl;\n\n},{}],27:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getDescription = getDescription;\nconst SYMBOL_INDEX_START = 7;\nconst SYMBOL_INDEX_END = -1;\nfunction getDescription(symbol) {\n    return symbol.toString().slice(SYMBOL_INDEX_START, SYMBOL_INDEX_END);\n}\n\n},{}],28:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateReflectMetadata = exports.getReflectMetadata = void 0;\nconst getReflectMetadata_1 = require(\"./reflectMetadata/utils/getReflectMetadata\");\nObject.defineProperty(exports, \"getReflectMetadata\", { enumerable: true, get: function () { return getReflectMetadata_1.getReflectMetadata; } });\nconst updateReflectMetadata_1 = require(\"./reflectMetadata/utils/updateReflectMetadata\");\nObject.defineProperty(exports, \"updateReflectMetadata\", { enumerable: true, get: function () { return updateReflectMetadata_1.updateReflectMetadata; } });\n\n},{\"./reflectMetadata/utils/getReflectMetadata\":29,\"./reflectMetadata/utils/updateReflectMetadata\":30}],29:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getReflectMetadata = getReflectMetadata;\n// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters\nfunction getReflectMetadata(target, metadataKey) {\n    return Reflect.getMetadata(metadataKey, target);\n}\n\n},{}],30:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateReflectMetadata = updateReflectMetadata;\nconst getReflectMetadata_1 = require(\"./getReflectMetadata\");\nfunction updateReflectMetadata(target, metadataKey, defaultValue, callback) {\n    const metadata = (0, getReflectMetadata_1.getReflectMetadata)(target, metadataKey) ?? defaultValue;\n    const updatedMetadata = callback(metadata);\n    Reflect.defineMetadata(metadataKey, updatedMetadata, target);\n}\n\n},{\"./getReflectMetadata\":29}],31:[function(require,module,exports){\nvar IDX=256, HEX=[], BUFFER;\nwhile (IDX--) HEX[IDX] = (IDX + 256).toString(16).substring(1);\n\nfunction v4() {\n\tvar i=0, num, out='';\n\n\tif (!BUFFER || ((IDX + 16) > 256)) {\n\t\tBUFFER = Array(i=256);\n\t\twhile (i--) BUFFER[i] = 256 * Math.random() | 0;\n\t\ti = IDX = 0;\n\t}\n\n\tfor (; i < 16; i++) {\n\t\tnum = BUFFER[IDX + i];\n\t\tif (i==6) out += HEX[num & 15 | 64];\n\t\telse if (i==8) out += HEX[num & 63 | 128];\n\t\telse out += HEX[num];\n\n\t\tif (i & 1 && i > 1 && i < 11) out += '-';\n\t}\n\n\tIDX++;\n\treturn out;\n}\n\nexports.v4 = v4;\n},{}],32:[function(require,module,exports){\n\"use strict\";\n\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TypeCompiler = exports.Policy = exports.TypeCompilerTypeGuardError = exports.TypeCompilerUnknownTypeError = exports.TypeCheck = void 0;\nvar index_1 = require(\"../value/transform/index\");\nvar index_2 = require(\"../errors/index\");\nvar index_3 = require(\"../system/index\");\nvar index_4 = require(\"../type/error/index\");\nvar index_5 = require(\"../value/deref/index\");\nvar index_6 = require(\"../value/hash/index\");\nvar index_7 = require(\"../type/symbols/index\");\nvar index_8 = require(\"../type/registry/index\");\nvar index_9 = require(\"../type/keyof/index\");\nvar extends_undefined_1 = require(\"../type/extends/extends-undefined\");\nvar index_10 = require(\"../type/never/index\");\nvar index_11 = require(\"../type/ref/index\");\n// ------------------------------------------------------------------\n// ValueGuard\n// ------------------------------------------------------------------\nvar index_12 = require(\"../value/guard/index\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar type_1 = require(\"../type/guard/type\");\n// ------------------------------------------------------------------\n// TypeCheck\n// ------------------------------------------------------------------\nvar TypeCheck = /*#__PURE__*/function () {\n  function TypeCheck(schema, references, checkFunc, code) {\n    _classCallCheck(this, TypeCheck);\n    this.schema = schema;\n    this.references = references;\n    this.checkFunc = checkFunc;\n    this.code = code;\n    this.hasTransform = (0, index_1.HasTransform)(schema, references);\n  }\n  /** Returns the generated assertion code used to validate this type. */\n  return _createClass(TypeCheck, [{\n    key: \"Code\",\n    value: function Code() {\n      return this.code;\n    }\n    /** Returns the schema type used to validate */\n  }, {\n    key: \"Schema\",\n    value: function Schema() {\n      return this.schema;\n    }\n    /** Returns reference types used to validate */\n  }, {\n    key: \"References\",\n    value: function References() {\n      return this.references;\n    }\n    /** Returns an iterator for each error in this value. */\n  }, {\n    key: \"Errors\",\n    value: function Errors(value) {\n      return (0, index_2.Errors)(this.schema, this.references, value);\n    }\n    /** Returns true if the value matches the compiled type. */\n  }, {\n    key: \"Check\",\n    value: function Check(value) {\n      return this.checkFunc(value);\n    }\n    /** Decodes a value or throws if error */\n  }, {\n    key: \"Decode\",\n    value: function Decode(value) {\n      if (!this.checkFunc(value)) throw new index_1.TransformDecodeCheckError(this.schema, value, this.Errors(value).First());\n      return this.hasTransform ? (0, index_1.TransformDecode)(this.schema, this.references, value) : value;\n    }\n    /** Encodes a value or throws if error */\n  }, {\n    key: \"Encode\",\n    value: function Encode(value) {\n      var encoded = this.hasTransform ? (0, index_1.TransformEncode)(this.schema, this.references, value) : value;\n      if (!this.checkFunc(encoded)) throw new index_1.TransformEncodeCheckError(this.schema, value, this.Errors(value).First());\n      return encoded;\n    }\n  }]);\n}();\nexports.TypeCheck = TypeCheck;\n// ------------------------------------------------------------------\n// Character\n// ------------------------------------------------------------------\nvar Character;\n(function (Character) {\n  function DollarSign(code) {\n    return code === 36;\n  }\n  Character.DollarSign = DollarSign;\n  function IsUnderscore(code) {\n    return code === 95;\n  }\n  Character.IsUnderscore = IsUnderscore;\n  function IsAlpha(code) {\n    return code >= 65 && code <= 90 || code >= 97 && code <= 122;\n  }\n  Character.IsAlpha = IsAlpha;\n  function IsNumeric(code) {\n    return code >= 48 && code <= 57;\n  }\n  Character.IsNumeric = IsNumeric;\n})(Character || (Character = {}));\n// ------------------------------------------------------------------\n// MemberExpression\n// ------------------------------------------------------------------\nvar MemberExpression;\n(function (MemberExpression) {\n  function IsFirstCharacterNumeric(value) {\n    if (value.length === 0) return false;\n    return Character.IsNumeric(value.charCodeAt(0));\n  }\n  function IsAccessor(value) {\n    if (IsFirstCharacterNumeric(value)) return false;\n    for (var i = 0; i < value.length; i++) {\n      var code = value.charCodeAt(i);\n      var check = Character.IsAlpha(code) || Character.IsNumeric(code) || Character.DollarSign(code) || Character.IsUnderscore(code);\n      if (!check) return false;\n    }\n    return true;\n  }\n  function EscapeHyphen(key) {\n    return key.replace(/'/g, \"\\\\'\");\n  }\n  function Encode(object, key) {\n    return IsAccessor(key) ? \"\".concat(object, \".\").concat(key) : \"\".concat(object, \"['\").concat(EscapeHyphen(key), \"']\");\n  }\n  MemberExpression.Encode = Encode;\n})(MemberExpression || (MemberExpression = {}));\n// ------------------------------------------------------------------\n// Identifier\n// ------------------------------------------------------------------\nvar Identifier;\n(function (Identifier) {\n  function Encode($id) {\n    var buffer = [];\n    for (var i = 0; i < $id.length; i++) {\n      var code = $id.charCodeAt(i);\n      if (Character.IsNumeric(code) || Character.IsAlpha(code)) {\n        buffer.push($id.charAt(i));\n      } else {\n        buffer.push(\"_\".concat(code, \"_\"));\n      }\n    }\n    return buffer.join('').replace(/__/g, '_');\n  }\n  Identifier.Encode = Encode;\n})(Identifier || (Identifier = {}));\n// ------------------------------------------------------------------\n// LiteralString\n// ------------------------------------------------------------------\nvar LiteralString;\n(function (LiteralString) {\n  function Escape(content) {\n    return content.replace(/'/g, \"\\\\'\");\n  }\n  LiteralString.Escape = Escape;\n})(LiteralString || (LiteralString = {}));\n// ------------------------------------------------------------------\n// Errors\n// ------------------------------------------------------------------\nvar TypeCompilerUnknownTypeError = /*#__PURE__*/function (_index_4$TypeBoxError) {\n  function TypeCompilerUnknownTypeError(schema) {\n    var _this;\n    _classCallCheck(this, TypeCompilerUnknownTypeError);\n    _this = _callSuper(this, TypeCompilerUnknownTypeError, ['Unknown type']);\n    _this.schema = schema;\n    return _this;\n  }\n  _inherits(TypeCompilerUnknownTypeError, _index_4$TypeBoxError);\n  return _createClass(TypeCompilerUnknownTypeError);\n}(index_4.TypeBoxError);\nexports.TypeCompilerUnknownTypeError = TypeCompilerUnknownTypeError;\nvar TypeCompilerTypeGuardError = /*#__PURE__*/function (_index_4$TypeBoxError2) {\n  function TypeCompilerTypeGuardError(schema) {\n    var _this2;\n    _classCallCheck(this, TypeCompilerTypeGuardError);\n    _this2 = _callSuper(this, TypeCompilerTypeGuardError, ['Preflight validation check failed to guard for the given schema']);\n    _this2.schema = schema;\n    return _this2;\n  }\n  _inherits(TypeCompilerTypeGuardError, _index_4$TypeBoxError2);\n  return _createClass(TypeCompilerTypeGuardError);\n}(index_4.TypeBoxError);\nexports.TypeCompilerTypeGuardError = TypeCompilerTypeGuardError;\n// ------------------------------------------------------------------\n// Policy\n// ------------------------------------------------------------------\nvar Policy;\n(function (Policy) {\n  function IsExactOptionalProperty(value, key, expression) {\n    return index_3.TypeSystemPolicy.ExactOptionalPropertyTypes ? \"('\".concat(key, \"' in \").concat(value, \" ? \").concat(expression, \" : true)\") : \"(\".concat(MemberExpression.Encode(value, key), \" !== undefined ? \").concat(expression, \" : true)\");\n  }\n  Policy.IsExactOptionalProperty = IsExactOptionalProperty;\n  function IsObjectLike(value) {\n    return !index_3.TypeSystemPolicy.AllowArrayObject ? \"(typeof \".concat(value, \" === 'object' && \").concat(value, \" !== null && !Array.isArray(\").concat(value, \"))\") : \"(typeof \".concat(value, \" === 'object' && \").concat(value, \" !== null)\");\n  }\n  Policy.IsObjectLike = IsObjectLike;\n  function IsRecordLike(value) {\n    return !index_3.TypeSystemPolicy.AllowArrayObject ? \"(typeof \".concat(value, \" === 'object' && \").concat(value, \" !== null && !Array.isArray(\").concat(value, \") && !(\").concat(value, \" instanceof Date) && !(\").concat(value, \" instanceof Uint8Array))\") : \"(typeof \".concat(value, \" === 'object' && \").concat(value, \" !== null && !(\").concat(value, \" instanceof Date) && !(\").concat(value, \" instanceof Uint8Array))\");\n  }\n  Policy.IsRecordLike = IsRecordLike;\n  function IsNumberLike(value) {\n    return index_3.TypeSystemPolicy.AllowNaN ? \"typeof \".concat(value, \" === 'number'\") : \"Number.isFinite(\".concat(value, \")\");\n  }\n  Policy.IsNumberLike = IsNumberLike;\n  function IsVoidLike(value) {\n    return index_3.TypeSystemPolicy.AllowNullVoid ? \"(\".concat(value, \" === undefined || \").concat(value, \" === null)\") : \"\".concat(value, \" === undefined\");\n  }\n  Policy.IsVoidLike = IsVoidLike;\n})(Policy || (exports.Policy = Policy = {}));\n/** Compiles Types for Runtime Type Checking */\nvar TypeCompiler;\n(function (TypeCompiler) {\n  var _marked = /*#__PURE__*/_regeneratorRuntime().mark(FromAny),\n    _marked2 = /*#__PURE__*/_regeneratorRuntime().mark(FromArgument),\n    _marked3 = /*#__PURE__*/_regeneratorRuntime().mark(FromArray),\n    _marked4 = /*#__PURE__*/_regeneratorRuntime().mark(FromAsyncIterator),\n    _marked5 = /*#__PURE__*/_regeneratorRuntime().mark(FromBigInt),\n    _marked6 = /*#__PURE__*/_regeneratorRuntime().mark(FromBoolean),\n    _marked7 = /*#__PURE__*/_regeneratorRuntime().mark(FromConstructor),\n    _marked8 = /*#__PURE__*/_regeneratorRuntime().mark(FromDate),\n    _marked9 = /*#__PURE__*/_regeneratorRuntime().mark(FromFunction),\n    _marked10 = /*#__PURE__*/_regeneratorRuntime().mark(FromImport),\n    _marked11 = /*#__PURE__*/_regeneratorRuntime().mark(FromInteger),\n    _marked12 = /*#__PURE__*/_regeneratorRuntime().mark(FromIntersect),\n    _marked13 = /*#__PURE__*/_regeneratorRuntime().mark(FromIterator),\n    _marked14 = /*#__PURE__*/_regeneratorRuntime().mark(FromLiteral),\n    _marked15 = /*#__PURE__*/_regeneratorRuntime().mark(FromNever),\n    _marked16 = /*#__PURE__*/_regeneratorRuntime().mark(FromNot),\n    _marked17 = /*#__PURE__*/_regeneratorRuntime().mark(FromNull),\n    _marked18 = /*#__PURE__*/_regeneratorRuntime().mark(FromNumber),\n    _marked19 = /*#__PURE__*/_regeneratorRuntime().mark(FromObject),\n    _marked20 = /*#__PURE__*/_regeneratorRuntime().mark(FromPromise),\n    _marked21 = /*#__PURE__*/_regeneratorRuntime().mark(FromRecord),\n    _marked22 = /*#__PURE__*/_regeneratorRuntime().mark(FromRef),\n    _marked23 = /*#__PURE__*/_regeneratorRuntime().mark(FromRegExp),\n    _marked24 = /*#__PURE__*/_regeneratorRuntime().mark(FromString),\n    _marked25 = /*#__PURE__*/_regeneratorRuntime().mark(FromSymbol),\n    _marked26 = /*#__PURE__*/_regeneratorRuntime().mark(FromTemplateLiteral),\n    _marked27 = /*#__PURE__*/_regeneratorRuntime().mark(FromThis),\n    _marked28 = /*#__PURE__*/_regeneratorRuntime().mark(FromTuple),\n    _marked29 = /*#__PURE__*/_regeneratorRuntime().mark(FromUndefined),\n    _marked30 = /*#__PURE__*/_regeneratorRuntime().mark(FromUnion),\n    _marked31 = /*#__PURE__*/_regeneratorRuntime().mark(FromUint8Array),\n    _marked32 = /*#__PURE__*/_regeneratorRuntime().mark(FromUnknown),\n    _marked33 = /*#__PURE__*/_regeneratorRuntime().mark(FromVoid),\n    _marked34 = /*#__PURE__*/_regeneratorRuntime().mark(FromKind);\n  // ----------------------------------------------------------------\n  // Guards\n  // ----------------------------------------------------------------\n  function IsAnyOrUnknown(schema) {\n    return schema[index_7.Kind] === 'Any' || schema[index_7.Kind] === 'Unknown';\n  }\n  // ----------------------------------------------------------------\n  // Types\n  // ----------------------------------------------------------------\n  function FromAny(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromAny$(_context) {\n      while (1) switch (_context.prev = _context.next) {\n        case 0:\n          _context.next = 2;\n          return 'true';\n        case 2:\n        case \"end\":\n          return _context.stop();\n      }\n    }, _marked);\n  }\n  function FromArgument(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromArgument$(_context2) {\n      while (1) switch (_context2.prev = _context2.next) {\n        case 0:\n          _context2.next = 2;\n          return 'true';\n        case 2:\n        case \"end\":\n          return _context2.stop();\n      }\n    }, _marked2);\n  }\n  function FromArray(schema, references, value) {\n    var _ref, parameter, accumulator, elementExpression, containsSchema, checkExpression, checkMinContains, checkMaxContains, checkCount, check, _check, block;\n    return _regeneratorRuntime().wrap(function FromArray$(_context3) {\n      while (1) switch (_context3.prev = _context3.next) {\n        case 0:\n          _context3.next = 2;\n          return \"Array.isArray(\".concat(value, \")\");\n        case 2:\n          _ref = [CreateParameter('value', 'any'), CreateParameter('acc', 'number')], parameter = _ref[0], accumulator = _ref[1];\n          if (!(0, index_12.IsNumber)(schema.maxItems)) {\n            _context3.next = 6;\n            break;\n          }\n          _context3.next = 6;\n          return \"\".concat(value, \".length <= \").concat(schema.maxItems);\n        case 6:\n          if (!(0, index_12.IsNumber)(schema.minItems)) {\n            _context3.next = 9;\n            break;\n          }\n          _context3.next = 9;\n          return \"\".concat(value, \".length >= \").concat(schema.minItems);\n        case 9:\n          elementExpression = CreateExpression(schema.items, references, 'value');\n          _context3.next = 12;\n          return \"\".concat(value, \".every((\").concat(parameter, \") => \").concat(elementExpression, \")\");\n        case 12:\n          if (!((0, type_1.IsSchema)(schema.contains) || (0, index_12.IsNumber)(schema.minContains) || (0, index_12.IsNumber)(schema.maxContains))) {\n            _context3.next = 21;\n            break;\n          }\n          containsSchema = (0, type_1.IsSchema)(schema.contains) ? schema.contains : (0, index_10.Never)();\n          checkExpression = CreateExpression(containsSchema, references, 'value');\n          checkMinContains = (0, index_12.IsNumber)(schema.minContains) ? [\"(count >= \".concat(schema.minContains, \")\")] : [];\n          checkMaxContains = (0, index_12.IsNumber)(schema.maxContains) ? [\"(count <= \".concat(schema.maxContains, \")\")] : [];\n          checkCount = \"const count = value.reduce((\".concat(accumulator, \", \").concat(parameter, \") => \").concat(checkExpression, \" ? acc + 1 : acc, 0)\");\n          check = [\"(count > 0)\"].concat(checkMinContains, checkMaxContains).join(' && ');\n          _context3.next = 21;\n          return \"((\".concat(parameter, \") => { \").concat(checkCount, \"; return \").concat(check, \"})(\").concat(value, \")\");\n        case 21:\n          if (!(schema.uniqueItems === true)) {\n            _context3.next = 26;\n            break;\n          }\n          _check = \"const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true\";\n          block = \"const set = new Set(); for(const element of value) { \".concat(_check, \" }\");\n          _context3.next = 26;\n          return \"((\".concat(parameter, \") => { \").concat(block, \" )(\").concat(value, \")\");\n        case 26:\n        case \"end\":\n          return _context3.stop();\n      }\n    }, _marked3);\n  }\n  function FromAsyncIterator(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromAsyncIterator$(_context4) {\n      while (1) switch (_context4.prev = _context4.next) {\n        case 0:\n          _context4.next = 2;\n          return \"(typeof value === 'object' && Symbol.asyncIterator in \".concat(value, \")\");\n        case 2:\n        case \"end\":\n          return _context4.stop();\n      }\n    }, _marked4);\n  }\n  function FromBigInt(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromBigInt$(_context5) {\n      while (1) switch (_context5.prev = _context5.next) {\n        case 0:\n          _context5.next = 2;\n          return \"(typeof \".concat(value, \" === 'bigint')\");\n        case 2:\n          if (!(0, index_12.IsBigInt)(schema.exclusiveMaximum)) {\n            _context5.next = 5;\n            break;\n          }\n          _context5.next = 5;\n          return \"\".concat(value, \" < BigInt(\").concat(schema.exclusiveMaximum, \")\");\n        case 5:\n          if (!(0, index_12.IsBigInt)(schema.exclusiveMinimum)) {\n            _context5.next = 8;\n            break;\n          }\n          _context5.next = 8;\n          return \"\".concat(value, \" > BigInt(\").concat(schema.exclusiveMinimum, \")\");\n        case 8:\n          if (!(0, index_12.IsBigInt)(schema.maximum)) {\n            _context5.next = 11;\n            break;\n          }\n          _context5.next = 11;\n          return \"\".concat(value, \" <= BigInt(\").concat(schema.maximum, \")\");\n        case 11:\n          if (!(0, index_12.IsBigInt)(schema.minimum)) {\n            _context5.next = 14;\n            break;\n          }\n          _context5.next = 14;\n          return \"\".concat(value, \" >= BigInt(\").concat(schema.minimum, \")\");\n        case 14:\n          if (!(0, index_12.IsBigInt)(schema.multipleOf)) {\n            _context5.next = 17;\n            break;\n          }\n          _context5.next = 17;\n          return \"(\".concat(value, \" % BigInt(\").concat(schema.multipleOf, \")) === 0\");\n        case 17:\n        case \"end\":\n          return _context5.stop();\n      }\n    }, _marked5);\n  }\n  function FromBoolean(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromBoolean$(_context6) {\n      while (1) switch (_context6.prev = _context6.next) {\n        case 0:\n          _context6.next = 2;\n          return \"(typeof \".concat(value, \" === 'boolean')\");\n        case 2:\n        case \"end\":\n          return _context6.stop();\n      }\n    }, _marked6);\n  }\n  function FromConstructor(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromConstructor$(_context7) {\n      while (1) switch (_context7.prev = _context7.next) {\n        case 0:\n          return _context7.delegateYield(Visit(schema.returns, references, \"\".concat(value, \".prototype\")), \"t0\", 1);\n        case 1:\n        case \"end\":\n          return _context7.stop();\n      }\n    }, _marked7);\n  }\n  function FromDate(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromDate$(_context8) {\n      while (1) switch (_context8.prev = _context8.next) {\n        case 0:\n          _context8.next = 2;\n          return \"(\".concat(value, \" instanceof Date) && Number.isFinite(\").concat(value, \".getTime())\");\n        case 2:\n          if (!(0, index_12.IsNumber)(schema.exclusiveMaximumTimestamp)) {\n            _context8.next = 5;\n            break;\n          }\n          _context8.next = 5;\n          return \"\".concat(value, \".getTime() < \").concat(schema.exclusiveMaximumTimestamp);\n        case 5:\n          if (!(0, index_12.IsNumber)(schema.exclusiveMinimumTimestamp)) {\n            _context8.next = 8;\n            break;\n          }\n          _context8.next = 8;\n          return \"\".concat(value, \".getTime() > \").concat(schema.exclusiveMinimumTimestamp);\n        case 8:\n          if (!(0, index_12.IsNumber)(schema.maximumTimestamp)) {\n            _context8.next = 11;\n            break;\n          }\n          _context8.next = 11;\n          return \"\".concat(value, \".getTime() <= \").concat(schema.maximumTimestamp);\n        case 11:\n          if (!(0, index_12.IsNumber)(schema.minimumTimestamp)) {\n            _context8.next = 14;\n            break;\n          }\n          _context8.next = 14;\n          return \"\".concat(value, \".getTime() >= \").concat(schema.minimumTimestamp);\n        case 14:\n          if (!(0, index_12.IsNumber)(schema.multipleOfTimestamp)) {\n            _context8.next = 17;\n            break;\n          }\n          _context8.next = 17;\n          return \"(\".concat(value, \".getTime() % \").concat(schema.multipleOfTimestamp, \") === 0\");\n        case 17:\n        case \"end\":\n          return _context8.stop();\n      }\n    }, _marked8);\n  }\n  function FromFunction(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromFunction$(_context9) {\n      while (1) switch (_context9.prev = _context9.next) {\n        case 0:\n          _context9.next = 2;\n          return \"(typeof \".concat(value, \" === 'function')\");\n        case 2:\n        case \"end\":\n          return _context9.stop();\n      }\n    }, _marked9);\n  }\n  function FromImport(schema, references, value) {\n    var members;\n    return _regeneratorRuntime().wrap(function FromImport$(_context10) {\n      while (1) switch (_context10.prev = _context10.next) {\n        case 0:\n          members = globalThis.Object.getOwnPropertyNames(schema.$defs).reduce(function (result, key) {\n            return [].concat(_toConsumableArray(result), [schema.$defs[key]]);\n          }, []);\n          return _context10.delegateYield(Visit((0, index_11.Ref)(schema.$ref), [].concat(_toConsumableArray(references), _toConsumableArray(members)), value), \"t0\", 2);\n        case 2:\n        case \"end\":\n          return _context10.stop();\n      }\n    }, _marked10);\n  }\n  function FromInteger(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromInteger$(_context11) {\n      while (1) switch (_context11.prev = _context11.next) {\n        case 0:\n          _context11.next = 2;\n          return \"Number.isInteger(\".concat(value, \")\");\n        case 2:\n          if (!(0, index_12.IsNumber)(schema.exclusiveMaximum)) {\n            _context11.next = 5;\n            break;\n          }\n          _context11.next = 5;\n          return \"\".concat(value, \" < \").concat(schema.exclusiveMaximum);\n        case 5:\n          if (!(0, index_12.IsNumber)(schema.exclusiveMinimum)) {\n            _context11.next = 8;\n            break;\n          }\n          _context11.next = 8;\n          return \"\".concat(value, \" > \").concat(schema.exclusiveMinimum);\n        case 8:\n          if (!(0, index_12.IsNumber)(schema.maximum)) {\n            _context11.next = 11;\n            break;\n          }\n          _context11.next = 11;\n          return \"\".concat(value, \" <= \").concat(schema.maximum);\n        case 11:\n          if (!(0, index_12.IsNumber)(schema.minimum)) {\n            _context11.next = 14;\n            break;\n          }\n          _context11.next = 14;\n          return \"\".concat(value, \" >= \").concat(schema.minimum);\n        case 14:\n          if (!(0, index_12.IsNumber)(schema.multipleOf)) {\n            _context11.next = 17;\n            break;\n          }\n          _context11.next = 17;\n          return \"(\".concat(value, \" % \").concat(schema.multipleOf, \") === 0\");\n        case 17:\n        case \"end\":\n          return _context11.stop();\n      }\n    }, _marked11);\n  }\n  function FromIntersect(schema, references, value) {\n    var check1, keyCheck, check2, _keyCheck, _check2;\n    return _regeneratorRuntime().wrap(function FromIntersect$(_context12) {\n      while (1) switch (_context12.prev = _context12.next) {\n        case 0:\n          check1 = schema.allOf.map(function (schema) {\n            return CreateExpression(schema, references, value);\n          }).join(' && ');\n          if (!(schema.unevaluatedProperties === false)) {\n            _context12.next = 8;\n            break;\n          }\n          keyCheck = CreateVariable(\"\".concat(new RegExp((0, index_9.KeyOfPattern)(schema)), \";\"));\n          check2 = \"Object.getOwnPropertyNames(\".concat(value, \").every(key => \").concat(keyCheck, \".test(key))\");\n          _context12.next = 6;\n          return \"(\".concat(check1, \" && \").concat(check2, \")\");\n        case 6:\n          _context12.next = 17;\n          break;\n        case 8:\n          if (!(0, type_1.IsSchema)(schema.unevaluatedProperties)) {\n            _context12.next = 15;\n            break;\n          }\n          _keyCheck = CreateVariable(\"\".concat(new RegExp((0, index_9.KeyOfPattern)(schema)), \";\"));\n          _check2 = \"Object.getOwnPropertyNames(\".concat(value, \").every(key => \").concat(_keyCheck, \".test(key) || \").concat(CreateExpression(schema.unevaluatedProperties, references, \"\".concat(value, \"[key]\")), \")\");\n          _context12.next = 13;\n          return \"(\".concat(check1, \" && \").concat(_check2, \")\");\n        case 13:\n          _context12.next = 17;\n          break;\n        case 15:\n          _context12.next = 17;\n          return \"(\".concat(check1, \")\");\n        case 17:\n        case \"end\":\n          return _context12.stop();\n      }\n    }, _marked12);\n  }\n  function FromIterator(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromIterator$(_context13) {\n      while (1) switch (_context13.prev = _context13.next) {\n        case 0:\n          _context13.next = 2;\n          return \"(typeof value === 'object' && Symbol.iterator in \".concat(value, \")\");\n        case 2:\n        case \"end\":\n          return _context13.stop();\n      }\n    }, _marked13);\n  }\n  function FromLiteral(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromLiteral$(_context14) {\n      while (1) switch (_context14.prev = _context14.next) {\n        case 0:\n          if (!(typeof schema[\"const\"] === 'number' || typeof schema[\"const\"] === 'boolean')) {\n            _context14.next = 5;\n            break;\n          }\n          _context14.next = 3;\n          return \"(\".concat(value, \" === \").concat(schema[\"const\"], \")\");\n        case 3:\n          _context14.next = 7;\n          break;\n        case 5:\n          _context14.next = 7;\n          return \"(\".concat(value, \" === '\").concat(LiteralString.Escape(schema[\"const\"]), \"')\");\n        case 7:\n        case \"end\":\n          return _context14.stop();\n      }\n    }, _marked14);\n  }\n  function FromNever(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromNever$(_context15) {\n      while (1) switch (_context15.prev = _context15.next) {\n        case 0:\n          _context15.next = 2;\n          return \"false\";\n        case 2:\n        case \"end\":\n          return _context15.stop();\n      }\n    }, _marked15);\n  }\n  function FromNot(schema, references, value) {\n    var expression;\n    return _regeneratorRuntime().wrap(function FromNot$(_context16) {\n      while (1) switch (_context16.prev = _context16.next) {\n        case 0:\n          expression = CreateExpression(schema.not, references, value);\n          _context16.next = 3;\n          return \"(!\".concat(expression, \")\");\n        case 3:\n        case \"end\":\n          return _context16.stop();\n      }\n    }, _marked16);\n  }\n  function FromNull(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromNull$(_context17) {\n      while (1) switch (_context17.prev = _context17.next) {\n        case 0:\n          _context17.next = 2;\n          return \"(\".concat(value, \" === null)\");\n        case 2:\n        case \"end\":\n          return _context17.stop();\n      }\n    }, _marked17);\n  }\n  function FromNumber(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromNumber$(_context18) {\n      while (1) switch (_context18.prev = _context18.next) {\n        case 0:\n          _context18.next = 2;\n          return Policy.IsNumberLike(value);\n        case 2:\n          if (!(0, index_12.IsNumber)(schema.exclusiveMaximum)) {\n            _context18.next = 5;\n            break;\n          }\n          _context18.next = 5;\n          return \"\".concat(value, \" < \").concat(schema.exclusiveMaximum);\n        case 5:\n          if (!(0, index_12.IsNumber)(schema.exclusiveMinimum)) {\n            _context18.next = 8;\n            break;\n          }\n          _context18.next = 8;\n          return \"\".concat(value, \" > \").concat(schema.exclusiveMinimum);\n        case 8:\n          if (!(0, index_12.IsNumber)(schema.maximum)) {\n            _context18.next = 11;\n            break;\n          }\n          _context18.next = 11;\n          return \"\".concat(value, \" <= \").concat(schema.maximum);\n        case 11:\n          if (!(0, index_12.IsNumber)(schema.minimum)) {\n            _context18.next = 14;\n            break;\n          }\n          _context18.next = 14;\n          return \"\".concat(value, \" >= \").concat(schema.minimum);\n        case 14:\n          if (!(0, index_12.IsNumber)(schema.multipleOf)) {\n            _context18.next = 17;\n            break;\n          }\n          _context18.next = 17;\n          return \"(\".concat(value, \" % \").concat(schema.multipleOf, \") === 0\");\n        case 17:\n        case \"end\":\n          return _context18.stop();\n      }\n    }, _marked18);\n  }\n  function FromObject(schema, references, value) {\n    var knownKeys, _iterator, _step, knownKey, memberExpression, property, _expression, keys, expression, _keys;\n    return _regeneratorRuntime().wrap(function FromObject$(_context19) {\n      while (1) switch (_context19.prev = _context19.next) {\n        case 0:\n          _context19.next = 2;\n          return Policy.IsObjectLike(value);\n        case 2:\n          if (!(0, index_12.IsNumber)(schema.minProperties)) {\n            _context19.next = 5;\n            break;\n          }\n          _context19.next = 5;\n          return \"Object.getOwnPropertyNames(\".concat(value, \").length >= \").concat(schema.minProperties);\n        case 5:\n          if (!(0, index_12.IsNumber)(schema.maxProperties)) {\n            _context19.next = 8;\n            break;\n          }\n          _context19.next = 8;\n          return \"Object.getOwnPropertyNames(\".concat(value, \").length <= \").concat(schema.maxProperties);\n        case 8:\n          knownKeys = Object.getOwnPropertyNames(schema.properties);\n          _iterator = _createForOfIteratorHelper(knownKeys);\n          _context19.prev = 10;\n          _iterator.s();\n        case 12:\n          if ((_step = _iterator.n()).done) {\n            _context19.next = 28;\n            break;\n          }\n          knownKey = _step.value;\n          memberExpression = MemberExpression.Encode(value, knownKey);\n          property = schema.properties[knownKey];\n          if (!(schema.required && schema.required.includes(knownKey))) {\n            _context19.next = 23;\n            break;\n          }\n          return _context19.delegateYield(Visit(property, references, memberExpression), \"t0\", 18);\n        case 18:\n          if (!((0, extends_undefined_1.ExtendsUndefinedCheck)(property) || IsAnyOrUnknown(property))) {\n            _context19.next = 21;\n            break;\n          }\n          _context19.next = 21;\n          return \"('\".concat(knownKey, \"' in \").concat(value, \")\");\n        case 21:\n          _context19.next = 26;\n          break;\n        case 23:\n          _expression = CreateExpression(property, references, memberExpression);\n          _context19.next = 26;\n          return Policy.IsExactOptionalProperty(value, knownKey, _expression);\n        case 26:\n          _context19.next = 12;\n          break;\n        case 28:\n          _context19.next = 33;\n          break;\n        case 30:\n          _context19.prev = 30;\n          _context19.t1 = _context19[\"catch\"](10);\n          _iterator.e(_context19.t1);\n        case 33:\n          _context19.prev = 33;\n          _iterator.f();\n          return _context19.finish(33);\n        case 36:\n          if (!(schema.additionalProperties === false)) {\n            _context19.next = 45;\n            break;\n          }\n          if (!(schema.required && schema.required.length === knownKeys.length)) {\n            _context19.next = 42;\n            break;\n          }\n          _context19.next = 40;\n          return \"Object.getOwnPropertyNames(\".concat(value, \").length === \").concat(knownKeys.length);\n        case 40:\n          _context19.next = 45;\n          break;\n        case 42:\n          keys = \"[\".concat(knownKeys.map(function (key) {\n            return \"'\".concat(key, \"'\");\n          }).join(', '), \"]\");\n          _context19.next = 45;\n          return \"Object.getOwnPropertyNames(\".concat(value, \").every(key => \").concat(keys, \".includes(key))\");\n        case 45:\n          if (!(_typeof(schema.additionalProperties) === 'object')) {\n            _context19.next = 50;\n            break;\n          }\n          expression = CreateExpression(schema.additionalProperties, references, \"\".concat(value, \"[key]\"));\n          _keys = \"[\".concat(knownKeys.map(function (key) {\n            return \"'\".concat(key, \"'\");\n          }).join(', '), \"]\");\n          _context19.next = 50;\n          return \"(Object.getOwnPropertyNames(\".concat(value, \").every(key => \").concat(_keys, \".includes(key) || \").concat(expression, \"))\");\n        case 50:\n        case \"end\":\n          return _context19.stop();\n      }\n    }, _marked19, null, [[10, 30, 33, 36]]);\n  }\n  function FromPromise(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromPromise$(_context20) {\n      while (1) switch (_context20.prev = _context20.next) {\n        case 0:\n          _context20.next = 2;\n          return \"\".concat(value, \" instanceof Promise\");\n        case 2:\n        case \"end\":\n          return _context20.stop();\n      }\n    }, _marked20);\n  }\n  function FromRecord(schema, references, value) {\n    var _Object$entries$, patternKey, patternSchema, variable, check1, check2, expression;\n    return _regeneratorRuntime().wrap(function FromRecord$(_context21) {\n      while (1) switch (_context21.prev = _context21.next) {\n        case 0:\n          _context21.next = 2;\n          return Policy.IsRecordLike(value);\n        case 2:\n          if (!(0, index_12.IsNumber)(schema.minProperties)) {\n            _context21.next = 5;\n            break;\n          }\n          _context21.next = 5;\n          return \"Object.getOwnPropertyNames(\".concat(value, \").length >= \").concat(schema.minProperties);\n        case 5:\n          if (!(0, index_12.IsNumber)(schema.maxProperties)) {\n            _context21.next = 8;\n            break;\n          }\n          _context21.next = 8;\n          return \"Object.getOwnPropertyNames(\".concat(value, \").length <= \").concat(schema.maxProperties);\n        case 8:\n          _Object$entries$ = _slicedToArray(Object.entries(schema.patternProperties)[0], 2), patternKey = _Object$entries$[0], patternSchema = _Object$entries$[1];\n          variable = CreateVariable(\"\".concat(new RegExp(patternKey)));\n          check1 = CreateExpression(patternSchema, references, 'value');\n          check2 = (0, type_1.IsSchema)(schema.additionalProperties) ? CreateExpression(schema.additionalProperties, references, value) : schema.additionalProperties === false ? 'false' : 'true';\n          expression = \"(\".concat(variable, \".test(key) ? \").concat(check1, \" : \").concat(check2, \")\");\n          _context21.next = 15;\n          return \"(Object.entries(\".concat(value, \").every(([key, value]) => \").concat(expression, \"))\");\n        case 15:\n        case \"end\":\n          return _context21.stop();\n      }\n    }, _marked21);\n  }\n  function FromRef(schema, references, value) {\n    var target;\n    return _regeneratorRuntime().wrap(function FromRef$(_context22) {\n      while (1) switch (_context22.prev = _context22.next) {\n        case 0:\n          target = (0, index_5.Deref)(schema, references); // Reference: If we have seen this reference before we can just yield and return the function call.\n          // If this isn't the case we defer to visit to generate and set the function for subsequent passes.\n          if (!state.functions.has(schema.$ref)) {\n            _context22.next = 5;\n            break;\n          }\n          _context22.next = 4;\n          return \"\".concat(CreateFunctionName(schema.$ref), \"(\").concat(value, \")\");\n        case 4:\n          return _context22.abrupt(\"return\", _context22.sent);\n        case 5:\n          return _context22.delegateYield(Visit(target, references, value), \"t0\", 6);\n        case 6:\n        case \"end\":\n          return _context22.stop();\n      }\n    }, _marked22);\n  }\n  function FromRegExp(schema, references, value) {\n    var variable;\n    return _regeneratorRuntime().wrap(function FromRegExp$(_context23) {\n      while (1) switch (_context23.prev = _context23.next) {\n        case 0:\n          variable = CreateVariable(\"\".concat(new RegExp(schema.source, schema.flags), \";\"));\n          _context23.next = 3;\n          return \"(typeof \".concat(value, \" === 'string')\");\n        case 3:\n          if (!(0, index_12.IsNumber)(schema.maxLength)) {\n            _context23.next = 6;\n            break;\n          }\n          _context23.next = 6;\n          return \"\".concat(value, \".length <= \").concat(schema.maxLength);\n        case 6:\n          if (!(0, index_12.IsNumber)(schema.minLength)) {\n            _context23.next = 9;\n            break;\n          }\n          _context23.next = 9;\n          return \"\".concat(value, \".length >= \").concat(schema.minLength);\n        case 9:\n          _context23.next = 11;\n          return \"\".concat(variable, \".test(\").concat(value, \")\");\n        case 11:\n        case \"end\":\n          return _context23.stop();\n      }\n    }, _marked23);\n  }\n  function FromString(schema, references, value) {\n    var variable;\n    return _regeneratorRuntime().wrap(function FromString$(_context24) {\n      while (1) switch (_context24.prev = _context24.next) {\n        case 0:\n          _context24.next = 2;\n          return \"(typeof \".concat(value, \" === 'string')\");\n        case 2:\n          if (!(0, index_12.IsNumber)(schema.maxLength)) {\n            _context24.next = 5;\n            break;\n          }\n          _context24.next = 5;\n          return \"\".concat(value, \".length <= \").concat(schema.maxLength);\n        case 5:\n          if (!(0, index_12.IsNumber)(schema.minLength)) {\n            _context24.next = 8;\n            break;\n          }\n          _context24.next = 8;\n          return \"\".concat(value, \".length >= \").concat(schema.minLength);\n        case 8:\n          if (!(schema.pattern !== undefined)) {\n            _context24.next = 12;\n            break;\n          }\n          variable = CreateVariable(\"\".concat(new RegExp(schema.pattern), \";\"));\n          _context24.next = 12;\n          return \"\".concat(variable, \".test(\").concat(value, \")\");\n        case 12:\n          if (!(schema.format !== undefined)) {\n            _context24.next = 15;\n            break;\n          }\n          _context24.next = 15;\n          return \"format('\".concat(schema.format, \"', \").concat(value, \")\");\n        case 15:\n        case \"end\":\n          return _context24.stop();\n      }\n    }, _marked24);\n  }\n  function FromSymbol(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromSymbol$(_context25) {\n      while (1) switch (_context25.prev = _context25.next) {\n        case 0:\n          _context25.next = 2;\n          return \"(typeof \".concat(value, \" === 'symbol')\");\n        case 2:\n        case \"end\":\n          return _context25.stop();\n      }\n    }, _marked25);\n  }\n  function FromTemplateLiteral(schema, references, value) {\n    var variable;\n    return _regeneratorRuntime().wrap(function FromTemplateLiteral$(_context26) {\n      while (1) switch (_context26.prev = _context26.next) {\n        case 0:\n          _context26.next = 2;\n          return \"(typeof \".concat(value, \" === 'string')\");\n        case 2:\n          variable = CreateVariable(\"\".concat(new RegExp(schema.pattern), \";\"));\n          _context26.next = 5;\n          return \"\".concat(variable, \".test(\").concat(value, \")\");\n        case 5:\n        case \"end\":\n          return _context26.stop();\n      }\n    }, _marked26);\n  }\n  function FromThis(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromThis$(_context27) {\n      while (1) switch (_context27.prev = _context27.next) {\n        case 0:\n          _context27.next = 2;\n          return \"\".concat(CreateFunctionName(schema.$ref), \"(\").concat(value, \")\");\n        case 2:\n        case \"end\":\n          return _context27.stop();\n      }\n    }, _marked27);\n  }\n  function FromTuple(schema, references, value) {\n    var i, expression;\n    return _regeneratorRuntime().wrap(function FromTuple$(_context28) {\n      while (1) switch (_context28.prev = _context28.next) {\n        case 0:\n          _context28.next = 2;\n          return \"Array.isArray(\".concat(value, \")\");\n        case 2:\n          if (!(schema.items === undefined)) {\n            _context28.next = 6;\n            break;\n          }\n          _context28.next = 5;\n          return \"\".concat(value, \".length === 0\");\n        case 5:\n          return _context28.abrupt(\"return\", _context28.sent);\n        case 6:\n          _context28.next = 8;\n          return \"(\".concat(value, \".length === \").concat(schema.maxItems, \")\");\n        case 8:\n          i = 0;\n        case 9:\n          if (!(i < schema.items.length)) {\n            _context28.next = 16;\n            break;\n          }\n          expression = CreateExpression(schema.items[i], references, \"\".concat(value, \"[\").concat(i, \"]\"));\n          _context28.next = 13;\n          return \"\".concat(expression);\n        case 13:\n          i++;\n          _context28.next = 9;\n          break;\n        case 16:\n        case \"end\":\n          return _context28.stop();\n      }\n    }, _marked28);\n  }\n  function FromUndefined(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromUndefined$(_context29) {\n      while (1) switch (_context29.prev = _context29.next) {\n        case 0:\n          _context29.next = 2;\n          return \"\".concat(value, \" === undefined\");\n        case 2:\n        case \"end\":\n          return _context29.stop();\n      }\n    }, _marked29);\n  }\n  function FromUnion(schema, references, value) {\n    var expressions;\n    return _regeneratorRuntime().wrap(function FromUnion$(_context30) {\n      while (1) switch (_context30.prev = _context30.next) {\n        case 0:\n          expressions = schema.anyOf.map(function (schema) {\n            return CreateExpression(schema, references, value);\n          });\n          _context30.next = 3;\n          return \"(\".concat(expressions.join(' || '), \")\");\n        case 3:\n        case \"end\":\n          return _context30.stop();\n      }\n    }, _marked30);\n  }\n  function FromUint8Array(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromUint8Array$(_context31) {\n      while (1) switch (_context31.prev = _context31.next) {\n        case 0:\n          _context31.next = 2;\n          return \"\".concat(value, \" instanceof Uint8Array\");\n        case 2:\n          if (!(0, index_12.IsNumber)(schema.maxByteLength)) {\n            _context31.next = 5;\n            break;\n          }\n          _context31.next = 5;\n          return \"(\".concat(value, \".length <= \").concat(schema.maxByteLength, \")\");\n        case 5:\n          if (!(0, index_12.IsNumber)(schema.minByteLength)) {\n            _context31.next = 8;\n            break;\n          }\n          _context31.next = 8;\n          return \"(\".concat(value, \".length >= \").concat(schema.minByteLength, \")\");\n        case 8:\n        case \"end\":\n          return _context31.stop();\n      }\n    }, _marked31);\n  }\n  function FromUnknown(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromUnknown$(_context32) {\n      while (1) switch (_context32.prev = _context32.next) {\n        case 0:\n          _context32.next = 2;\n          return 'true';\n        case 2:\n        case \"end\":\n          return _context32.stop();\n      }\n    }, _marked32);\n  }\n  function FromVoid(schema, references, value) {\n    return _regeneratorRuntime().wrap(function FromVoid$(_context33) {\n      while (1) switch (_context33.prev = _context33.next) {\n        case 0:\n          _context33.next = 2;\n          return Policy.IsVoidLike(value);\n        case 2:\n        case \"end\":\n          return _context33.stop();\n      }\n    }, _marked33);\n  }\n  function FromKind(schema, references, value) {\n    var instance;\n    return _regeneratorRuntime().wrap(function FromKind$(_context34) {\n      while (1) switch (_context34.prev = _context34.next) {\n        case 0:\n          instance = state.instances.size;\n          state.instances.set(instance, schema);\n          _context34.next = 4;\n          return \"kind('\".concat(schema[index_7.Kind], \"', \").concat(instance, \", \").concat(value, \")\");\n        case 4:\n        case \"end\":\n          return _context34.stop();\n      }\n    }, _marked34);\n  }\n  function Visit(schema, references, value) {\n    var useHoisting = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n    return /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n      var references_, schema_, functionName, functionCode;\n      return _regeneratorRuntime().wrap(function _callee$(_context35) {\n        while (1) switch (_context35.prev = _context35.next) {\n          case 0:\n            references_ = (0, index_12.IsString)(schema.$id) ? [].concat(_toConsumableArray(references), [schema]) : references;\n            schema_ = schema; // --------------------------------------------------------------\n            // Hoisting\n            // --------------------------------------------------------------\n            if (!(useHoisting && (0, index_12.IsString)(schema.$id))) {\n              _context35.next = 16;\n              break;\n            }\n            functionName = CreateFunctionName(schema.$id);\n            if (!state.functions.has(functionName)) {\n              _context35.next = 10;\n              break;\n            }\n            _context35.next = 7;\n            return \"\".concat(functionName, \"(\").concat(value, \")\");\n          case 7:\n            return _context35.abrupt(\"return\", _context35.sent);\n          case 10:\n            // Note: In the case of cyclic types, we need to create a 'functions' record\n            // to prevent infinitely re-visiting the CreateFunction. Subsequent attempts\n            // to visit will be caught by the above condition.\n            state.functions.set(functionName, '<deferred>');\n            functionCode = CreateFunction(functionName, schema, references, 'value', false);\n            state.functions.set(functionName, functionCode);\n            _context35.next = 15;\n            return \"\".concat(functionName, \"(\").concat(value, \")\");\n          case 15:\n            return _context35.abrupt(\"return\", _context35.sent);\n          case 16:\n            _context35.t0 = schema_[index_7.Kind];\n            _context35.next = _context35.t0 === 'Any' ? 19 : _context35.t0 === 'Argument' ? 21 : _context35.t0 === 'Array' ? 23 : _context35.t0 === 'AsyncIterator' ? 25 : _context35.t0 === 'BigInt' ? 27 : _context35.t0 === 'Boolean' ? 29 : _context35.t0 === 'Constructor' ? 31 : _context35.t0 === 'Date' ? 33 : _context35.t0 === 'Function' ? 35 : _context35.t0 === 'Import' ? 37 : _context35.t0 === 'Integer' ? 39 : _context35.t0 === 'Intersect' ? 41 : _context35.t0 === 'Iterator' ? 43 : _context35.t0 === 'Literal' ? 45 : _context35.t0 === 'Never' ? 47 : _context35.t0 === 'Not' ? 49 : _context35.t0 === 'Null' ? 51 : _context35.t0 === 'Number' ? 53 : _context35.t0 === 'Object' ? 55 : _context35.t0 === 'Promise' ? 57 : _context35.t0 === 'Record' ? 59 : _context35.t0 === 'Ref' ? 61 : _context35.t0 === 'RegExp' ? 63 : _context35.t0 === 'String' ? 65 : _context35.t0 === 'Symbol' ? 67 : _context35.t0 === 'TemplateLiteral' ? 69 : _context35.t0 === 'This' ? 71 : _context35.t0 === 'Tuple' ? 73 : _context35.t0 === 'Undefined' ? 75 : _context35.t0 === 'Union' ? 77 : _context35.t0 === 'Uint8Array' ? 79 : _context35.t0 === 'Unknown' ? 81 : _context35.t0 === 'Void' ? 83 : 85;\n            break;\n          case 19:\n            return _context35.delegateYield(FromAny(schema_, references_, value), \"t1\", 20);\n          case 20:\n            return _context35.abrupt(\"return\", _context35.t1);\n          case 21:\n            return _context35.delegateYield(FromArgument(schema_, references_, value), \"t2\", 22);\n          case 22:\n            return _context35.abrupt(\"return\", _context35.t2);\n          case 23:\n            return _context35.delegateYield(FromArray(schema_, references_, value), \"t3\", 24);\n          case 24:\n            return _context35.abrupt(\"return\", _context35.t3);\n          case 25:\n            return _context35.delegateYield(FromAsyncIterator(schema_, references_, value), \"t4\", 26);\n          case 26:\n            return _context35.abrupt(\"return\", _context35.t4);\n          case 27:\n            return _context35.delegateYield(FromBigInt(schema_, references_, value), \"t5\", 28);\n          case 28:\n            return _context35.abrupt(\"return\", _context35.t5);\n          case 29:\n            return _context35.delegateYield(FromBoolean(schema_, references_, value), \"t6\", 30);\n          case 30:\n            return _context35.abrupt(\"return\", _context35.t6);\n          case 31:\n            return _context35.delegateYield(FromConstructor(schema_, references_, value), \"t7\", 32);\n          case 32:\n            return _context35.abrupt(\"return\", _context35.t7);\n          case 33:\n            return _context35.delegateYield(FromDate(schema_, references_, value), \"t8\", 34);\n          case 34:\n            return _context35.abrupt(\"return\", _context35.t8);\n          case 35:\n            return _context35.delegateYield(FromFunction(schema_, references_, value), \"t9\", 36);\n          case 36:\n            return _context35.abrupt(\"return\", _context35.t9);\n          case 37:\n            return _context35.delegateYield(FromImport(schema_, references_, value), \"t10\", 38);\n          case 38:\n            return _context35.abrupt(\"return\", _context35.t10);\n          case 39:\n            return _context35.delegateYield(FromInteger(schema_, references_, value), \"t11\", 40);\n          case 40:\n            return _context35.abrupt(\"return\", _context35.t11);\n          case 41:\n            return _context35.delegateYield(FromIntersect(schema_, references_, value), \"t12\", 42);\n          case 42:\n            return _context35.abrupt(\"return\", _context35.t12);\n          case 43:\n            return _context35.delegateYield(FromIterator(schema_, references_, value), \"t13\", 44);\n          case 44:\n            return _context35.abrupt(\"return\", _context35.t13);\n          case 45:\n            return _context35.delegateYield(FromLiteral(schema_, references_, value), \"t14\", 46);\n          case 46:\n            return _context35.abrupt(\"return\", _context35.t14);\n          case 47:\n            return _context35.delegateYield(FromNever(schema_, references_, value), \"t15\", 48);\n          case 48:\n            return _context35.abrupt(\"return\", _context35.t15);\n          case 49:\n            return _context35.delegateYield(FromNot(schema_, references_, value), \"t16\", 50);\n          case 50:\n            return _context35.abrupt(\"return\", _context35.t16);\n          case 51:\n            return _context35.delegateYield(FromNull(schema_, references_, value), \"t17\", 52);\n          case 52:\n            return _context35.abrupt(\"return\", _context35.t17);\n          case 53:\n            return _context35.delegateYield(FromNumber(schema_, references_, value), \"t18\", 54);\n          case 54:\n            return _context35.abrupt(\"return\", _context35.t18);\n          case 55:\n            return _context35.delegateYield(FromObject(schema_, references_, value), \"t19\", 56);\n          case 56:\n            return _context35.abrupt(\"return\", _context35.t19);\n          case 57:\n            return _context35.delegateYield(FromPromise(schema_, references_, value), \"t20\", 58);\n          case 58:\n            return _context35.abrupt(\"return\", _context35.t20);\n          case 59:\n            return _context35.delegateYield(FromRecord(schema_, references_, value), \"t21\", 60);\n          case 60:\n            return _context35.abrupt(\"return\", _context35.t21);\n          case 61:\n            return _context35.delegateYield(FromRef(schema_, references_, value), \"t22\", 62);\n          case 62:\n            return _context35.abrupt(\"return\", _context35.t22);\n          case 63:\n            return _context35.delegateYield(FromRegExp(schema_, references_, value), \"t23\", 64);\n          case 64:\n            return _context35.abrupt(\"return\", _context35.t23);\n          case 65:\n            return _context35.delegateYield(FromString(schema_, references_, value), \"t24\", 66);\n          case 66:\n            return _context35.abrupt(\"return\", _context35.t24);\n          case 67:\n            return _context35.delegateYield(FromSymbol(schema_, references_, value), \"t25\", 68);\n          case 68:\n            return _context35.abrupt(\"return\", _context35.t25);\n          case 69:\n            return _context35.delegateYield(FromTemplateLiteral(schema_, references_, value), \"t26\", 70);\n          case 70:\n            return _context35.abrupt(\"return\", _context35.t26);\n          case 71:\n            return _context35.delegateYield(FromThis(schema_, references_, value), \"t27\", 72);\n          case 72:\n            return _context35.abrupt(\"return\", _context35.t27);\n          case 73:\n            return _context35.delegateYield(FromTuple(schema_, references_, value), \"t28\", 74);\n          case 74:\n            return _context35.abrupt(\"return\", _context35.t28);\n          case 75:\n            return _context35.delegateYield(FromUndefined(schema_, references_, value), \"t29\", 76);\n          case 76:\n            return _context35.abrupt(\"return\", _context35.t29);\n          case 77:\n            return _context35.delegateYield(FromUnion(schema_, references_, value), \"t30\", 78);\n          case 78:\n            return _context35.abrupt(\"return\", _context35.t30);\n          case 79:\n            return _context35.delegateYield(FromUint8Array(schema_, references_, value), \"t31\", 80);\n          case 80:\n            return _context35.abrupt(\"return\", _context35.t31);\n          case 81:\n            return _context35.delegateYield(FromUnknown(schema_, references_, value), \"t32\", 82);\n          case 82:\n            return _context35.abrupt(\"return\", _context35.t32);\n          case 83:\n            return _context35.delegateYield(FromVoid(schema_, references_, value), \"t33\", 84);\n          case 84:\n            return _context35.abrupt(\"return\", _context35.t33);\n          case 85:\n            if (index_8.TypeRegistry.Has(schema_[index_7.Kind])) {\n              _context35.next = 87;\n              break;\n            }\n            throw new TypeCompilerUnknownTypeError(schema);\n          case 87:\n            return _context35.delegateYield(FromKind(schema_, references_, value), \"t34\", 88);\n          case 88:\n            return _context35.abrupt(\"return\", _context35.t34);\n          case 89:\n          case \"end\":\n            return _context35.stop();\n        }\n      }, _callee);\n    })();\n  }\n  // ----------------------------------------------------------------\n  // Compiler State\n  // ----------------------------------------------------------------\n  // prettier-ignore\n  var state = {\n    language: 'javascript',\n    // target language\n    functions: new Map(),\n    // local functions\n    variables: new Map(),\n    // local variables\n    instances: new Map() // exterior kind instances\n  };\n  // ----------------------------------------------------------------\n  // Compiler Factory\n  // ----------------------------------------------------------------\n  function CreateExpression(schema, references, value) {\n    var useHoisting = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n    return \"(\".concat(_toConsumableArray(Visit(schema, references, value, useHoisting)).join(' && '), \")\");\n  }\n  function CreateFunctionName($id) {\n    return \"check_\".concat(Identifier.Encode($id));\n  }\n  function CreateVariable(expression) {\n    var variableName = \"local_\".concat(state.variables.size);\n    state.variables.set(variableName, \"const \".concat(variableName, \" = \").concat(expression));\n    return variableName;\n  }\n  function CreateFunction(name, schema, references, value) {\n    var useHoisting = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n    var newline = '\\n',\n      pad = function pad(length) {\n        return ''.padStart(length, ' ');\n      };\n    var parameter = CreateParameter('value', 'any');\n    var returns = CreateReturns('boolean');\n    var expression = _toConsumableArray(Visit(schema, references, value, useHoisting)).map(function (expression) {\n      return \"\".concat(pad(4)).concat(expression);\n    }).join(\" &&\".concat(newline));\n    return \"function \".concat(name, \"(\").concat(parameter, \")\").concat(returns, \" {\").concat(newline).concat(pad(2), \"return (\").concat(newline).concat(expression).concat(newline).concat(pad(2), \")\\n}\");\n  }\n  function CreateParameter(name, type) {\n    var annotation = state.language === 'typescript' ? \": \".concat(type) : '';\n    return \"\".concat(name).concat(annotation);\n  }\n  function CreateReturns(type) {\n    return state.language === 'typescript' ? \": \".concat(type) : '';\n  }\n  // ----------------------------------------------------------------\n  // Compile\n  // ----------------------------------------------------------------\n  function Build(schema, references, options) {\n    var functionCode = CreateFunction('check', schema, references, 'value'); // will populate functions and variables\n    var parameter = CreateParameter('value', 'any');\n    var returns = CreateReturns('boolean');\n    var functions = _toConsumableArray(state.functions.values());\n    var variables = _toConsumableArray(state.variables.values());\n    // prettier-ignore\n    var checkFunction = (0, index_12.IsString)(schema.$id) // ensure top level schemas with $id's are hoisted\n    ? \"return function check(\".concat(parameter, \")\").concat(returns, \" {\\n  return \").concat(CreateFunctionName(schema.$id), \"(value)\\n}\") : \"return \".concat(functionCode);\n    return [].concat(_toConsumableArray(variables), _toConsumableArray(functions), [checkFunction]).join('\\n');\n  }\n  /** Generates the code used to assert this type and returns it as a string */\n  function Code() {\n    var defaults = {\n      language: 'javascript'\n    };\n    // prettier-ignore\n    var _ref2 = arguments.length === 2 && (0, index_12.IsArray)(arguments.length <= 1 ? undefined : arguments[1]) ? [arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1], defaults] : arguments.length === 2 && !(0, index_12.IsArray)(arguments.length <= 1 ? undefined : arguments[1]) ? [arguments.length <= 0 ? undefined : arguments[0], [], arguments.length <= 1 ? undefined : arguments[1]] : arguments.length === 3 ? [arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1], arguments.length <= 2 ? undefined : arguments[2]] : arguments.length === 1 ? [arguments.length <= 0 ? undefined : arguments[0], [], defaults] : [null, [], defaults],\n      _ref3 = _slicedToArray(_ref2, 3),\n      schema = _ref3[0],\n      references = _ref3[1],\n      options = _ref3[2];\n    // compiler-reset\n    state.language = options.language;\n    state.variables.clear();\n    state.functions.clear();\n    state.instances.clear();\n    if (!(0, type_1.IsSchema)(schema)) throw new TypeCompilerTypeGuardError(schema);\n    var _iterator2 = _createForOfIteratorHelper(references),\n      _step2;\n    try {\n      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n        var _schema = _step2.value;\n        if (!(0, type_1.IsSchema)(_schema)) throw new TypeCompilerTypeGuardError(_schema);\n      }\n    } catch (err) {\n      _iterator2.e(err);\n    } finally {\n      _iterator2.f();\n    }\n    return Build(schema, references, options);\n  }\n  TypeCompiler.Code = Code;\n  /** Compiles a TypeBox type for optimal runtime type checking. Types must be valid TypeBox types of TSchema */\n  function Compile(schema) {\n    var references = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n    var generatedCode = Code(schema, references, {\n      language: 'javascript'\n    });\n    var compiledFunction = globalThis.Function('kind', 'format', 'hash', generatedCode);\n    var instances = new Map(state.instances);\n    function typeRegistryFunction(kind, instance, value) {\n      if (!index_8.TypeRegistry.Has(kind) || !instances.has(instance)) return false;\n      var checkFunc = index_8.TypeRegistry.Get(kind);\n      var schema = instances.get(instance);\n      return checkFunc(schema, value);\n    }\n    function formatRegistryFunction(format, value) {\n      if (!index_8.FormatRegistry.Has(format)) return false;\n      var checkFunc = index_8.FormatRegistry.Get(format);\n      return checkFunc(value);\n    }\n    function hashFunction(value) {\n      return (0, index_6.Hash)(value);\n    }\n    var checkFunction = compiledFunction(typeRegistryFunction, formatRegistryFunction, hashFunction);\n    return new TypeCheck(schema, references, checkFunction, generatedCode);\n  }\n  TypeCompiler.Compile = Compile;\n})(TypeCompiler || (exports.TypeCompiler = TypeCompiler = {}));\n\n},{\"../errors/index\":36,\"../system/index\":38,\"../type/error/index\":78,\"../type/extends/extends-undefined\":86,\"../type/guard/type\":97,\"../type/keyof/index\":126,\"../type/never/index\":140,\"../type/ref/index\":179,\"../type/registry/index\":184,\"../type/symbols/index\":204,\"../value/deref/index\":240,\"../value/guard/index\":242,\"../value/hash/index\":244,\"../value/transform/index\":248}],33:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ValueErrorIterator = exports.ValueErrorType = void 0;\nvar index_1 = require(\"../errors/index\");\nObject.defineProperty(exports, \"ValueErrorType\", {\n  enumerable: true,\n  get: function get() {\n    return index_1.ValueErrorType;\n  }\n});\nObject.defineProperty(exports, \"ValueErrorIterator\", {\n  enumerable: true,\n  get: function get() {\n    return index_1.ValueErrorIterator;\n  }\n});\n__exportStar(require(\"./compiler\"), exports);\n\n},{\"../errors/index\":36,\"./compiler\":32}],34:[function(require,module,exports){\n\"use strict\";\n\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nvar _marked = /*#__PURE__*/_regeneratorRuntime().mark(FromAny),\n  _marked2 = /*#__PURE__*/_regeneratorRuntime().mark(FromArgument),\n  _marked3 = /*#__PURE__*/_regeneratorRuntime().mark(FromArray),\n  _marked4 = /*#__PURE__*/_regeneratorRuntime().mark(FromAsyncIterator),\n  _marked5 = /*#__PURE__*/_regeneratorRuntime().mark(FromBigInt),\n  _marked6 = /*#__PURE__*/_regeneratorRuntime().mark(FromBoolean),\n  _marked7 = /*#__PURE__*/_regeneratorRuntime().mark(FromConstructor),\n  _marked8 = /*#__PURE__*/_regeneratorRuntime().mark(FromDate),\n  _marked9 = /*#__PURE__*/_regeneratorRuntime().mark(FromFunction),\n  _marked10 = /*#__PURE__*/_regeneratorRuntime().mark(FromImport),\n  _marked11 = /*#__PURE__*/_regeneratorRuntime().mark(FromInteger),\n  _marked12 = /*#__PURE__*/_regeneratorRuntime().mark(FromIntersect),\n  _marked13 = /*#__PURE__*/_regeneratorRuntime().mark(FromIterator),\n  _marked14 = /*#__PURE__*/_regeneratorRuntime().mark(FromLiteral),\n  _marked15 = /*#__PURE__*/_regeneratorRuntime().mark(FromNever),\n  _marked16 = /*#__PURE__*/_regeneratorRuntime().mark(FromNot),\n  _marked17 = /*#__PURE__*/_regeneratorRuntime().mark(FromNull),\n  _marked18 = /*#__PURE__*/_regeneratorRuntime().mark(FromNumber),\n  _marked19 = /*#__PURE__*/_regeneratorRuntime().mark(FromObject),\n  _marked20 = /*#__PURE__*/_regeneratorRuntime().mark(FromPromise),\n  _marked21 = /*#__PURE__*/_regeneratorRuntime().mark(FromRecord),\n  _marked22 = /*#__PURE__*/_regeneratorRuntime().mark(FromRef),\n  _marked23 = /*#__PURE__*/_regeneratorRuntime().mark(FromRegExp),\n  _marked24 = /*#__PURE__*/_regeneratorRuntime().mark(FromString),\n  _marked25 = /*#__PURE__*/_regeneratorRuntime().mark(FromSymbol),\n  _marked26 = /*#__PURE__*/_regeneratorRuntime().mark(FromTemplateLiteral),\n  _marked27 = /*#__PURE__*/_regeneratorRuntime().mark(FromThis),\n  _marked28 = /*#__PURE__*/_regeneratorRuntime().mark(FromTuple),\n  _marked29 = /*#__PURE__*/_regeneratorRuntime().mark(FromUndefined),\n  _marked30 = /*#__PURE__*/_regeneratorRuntime().mark(FromUnion),\n  _marked31 = /*#__PURE__*/_regeneratorRuntime().mark(FromUint8Array),\n  _marked32 = /*#__PURE__*/_regeneratorRuntime().mark(FromUnknown),\n  _marked33 = /*#__PURE__*/_regeneratorRuntime().mark(FromVoid),\n  _marked34 = /*#__PURE__*/_regeneratorRuntime().mark(FromKind),\n  _marked35 = /*#__PURE__*/_regeneratorRuntime().mark(Visit);\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ValueErrorIterator = exports.ValueErrorsUnknownTypeError = exports.ValueErrorType = void 0;\nexports.Errors = Errors;\nvar index_1 = require(\"../system/index\");\nvar index_2 = require(\"../type/keyof/index\");\nvar index_3 = require(\"../type/registry/index\");\nvar extends_undefined_1 = require(\"../type/extends/extends-undefined\");\nvar function_1 = require(\"./function\");\nvar index_4 = require(\"../type/error/index\");\nvar index_5 = require(\"../value/deref/index\");\nvar index_6 = require(\"../value/hash/index\");\nvar index_7 = require(\"../value/check/index\");\nvar index_8 = require(\"../type/symbols/index\");\nvar index_9 = require(\"../type/never/index\");\n// ------------------------------------------------------------------\n// ValueGuard\n// ------------------------------------------------------------------\n// prettier-ignore\nvar index_10 = require(\"../value/guard/index\");\n// ------------------------------------------------------------------\n// ValueErrorType\n// ------------------------------------------------------------------\nvar ValueErrorType;\n(function (ValueErrorType) {\n  ValueErrorType[ValueErrorType[\"ArrayContains\"] = 0] = \"ArrayContains\";\n  ValueErrorType[ValueErrorType[\"ArrayMaxContains\"] = 1] = \"ArrayMaxContains\";\n  ValueErrorType[ValueErrorType[\"ArrayMaxItems\"] = 2] = \"ArrayMaxItems\";\n  ValueErrorType[ValueErrorType[\"ArrayMinContains\"] = 3] = \"ArrayMinContains\";\n  ValueErrorType[ValueErrorType[\"ArrayMinItems\"] = 4] = \"ArrayMinItems\";\n  ValueErrorType[ValueErrorType[\"ArrayUniqueItems\"] = 5] = \"ArrayUniqueItems\";\n  ValueErrorType[ValueErrorType[\"Array\"] = 6] = \"Array\";\n  ValueErrorType[ValueErrorType[\"AsyncIterator\"] = 7] = \"AsyncIterator\";\n  ValueErrorType[ValueErrorType[\"BigIntExclusiveMaximum\"] = 8] = \"BigIntExclusiveMaximum\";\n  ValueErrorType[ValueErrorType[\"BigIntExclusiveMinimum\"] = 9] = \"BigIntExclusiveMinimum\";\n  ValueErrorType[ValueErrorType[\"BigIntMaximum\"] = 10] = \"BigIntMaximum\";\n  ValueErrorType[ValueErrorType[\"BigIntMinimum\"] = 11] = \"BigIntMinimum\";\n  ValueErrorType[ValueErrorType[\"BigIntMultipleOf\"] = 12] = \"BigIntMultipleOf\";\n  ValueErrorType[ValueErrorType[\"BigInt\"] = 13] = \"BigInt\";\n  ValueErrorType[ValueErrorType[\"Boolean\"] = 14] = \"Boolean\";\n  ValueErrorType[ValueErrorType[\"DateExclusiveMaximumTimestamp\"] = 15] = \"DateExclusiveMaximumTimestamp\";\n  ValueErrorType[ValueErrorType[\"DateExclusiveMinimumTimestamp\"] = 16] = \"DateExclusiveMinimumTimestamp\";\n  ValueErrorType[ValueErrorType[\"DateMaximumTimestamp\"] = 17] = \"DateMaximumTimestamp\";\n  ValueErrorType[ValueErrorType[\"DateMinimumTimestamp\"] = 18] = \"DateMinimumTimestamp\";\n  ValueErrorType[ValueErrorType[\"DateMultipleOfTimestamp\"] = 19] = \"DateMultipleOfTimestamp\";\n  ValueErrorType[ValueErrorType[\"Date\"] = 20] = \"Date\";\n  ValueErrorType[ValueErrorType[\"Function\"] = 21] = \"Function\";\n  ValueErrorType[ValueErrorType[\"IntegerExclusiveMaximum\"] = 22] = \"IntegerExclusiveMaximum\";\n  ValueErrorType[ValueErrorType[\"IntegerExclusiveMinimum\"] = 23] = \"IntegerExclusiveMinimum\";\n  ValueErrorType[ValueErrorType[\"IntegerMaximum\"] = 24] = \"IntegerMaximum\";\n  ValueErrorType[ValueErrorType[\"IntegerMinimum\"] = 25] = \"IntegerMinimum\";\n  ValueErrorType[ValueErrorType[\"IntegerMultipleOf\"] = 26] = \"IntegerMultipleOf\";\n  ValueErrorType[ValueErrorType[\"Integer\"] = 27] = \"Integer\";\n  ValueErrorType[ValueErrorType[\"IntersectUnevaluatedProperties\"] = 28] = \"IntersectUnevaluatedProperties\";\n  ValueErrorType[ValueErrorType[\"Intersect\"] = 29] = \"Intersect\";\n  ValueErrorType[ValueErrorType[\"Iterator\"] = 30] = \"Iterator\";\n  ValueErrorType[ValueErrorType[\"Kind\"] = 31] = \"Kind\";\n  ValueErrorType[ValueErrorType[\"Literal\"] = 32] = \"Literal\";\n  ValueErrorType[ValueErrorType[\"Never\"] = 33] = \"Never\";\n  ValueErrorType[ValueErrorType[\"Not\"] = 34] = \"Not\";\n  ValueErrorType[ValueErrorType[\"Null\"] = 35] = \"Null\";\n  ValueErrorType[ValueErrorType[\"NumberExclusiveMaximum\"] = 36] = \"NumberExclusiveMaximum\";\n  ValueErrorType[ValueErrorType[\"NumberExclusiveMinimum\"] = 37] = \"NumberExclusiveMinimum\";\n  ValueErrorType[ValueErrorType[\"NumberMaximum\"] = 38] = \"NumberMaximum\";\n  ValueErrorType[ValueErrorType[\"NumberMinimum\"] = 39] = \"NumberMinimum\";\n  ValueErrorType[ValueErrorType[\"NumberMultipleOf\"] = 40] = \"NumberMultipleOf\";\n  ValueErrorType[ValueErrorType[\"Number\"] = 41] = \"Number\";\n  ValueErrorType[ValueErrorType[\"ObjectAdditionalProperties\"] = 42] = \"ObjectAdditionalProperties\";\n  ValueErrorType[ValueErrorType[\"ObjectMaxProperties\"] = 43] = \"ObjectMaxProperties\";\n  ValueErrorType[ValueErrorType[\"ObjectMinProperties\"] = 44] = \"ObjectMinProperties\";\n  ValueErrorType[ValueErrorType[\"ObjectRequiredProperty\"] = 45] = \"ObjectRequiredProperty\";\n  ValueErrorType[ValueErrorType[\"Object\"] = 46] = \"Object\";\n  ValueErrorType[ValueErrorType[\"Promise\"] = 47] = \"Promise\";\n  ValueErrorType[ValueErrorType[\"RegExp\"] = 48] = \"RegExp\";\n  ValueErrorType[ValueErrorType[\"StringFormatUnknown\"] = 49] = \"StringFormatUnknown\";\n  ValueErrorType[ValueErrorType[\"StringFormat\"] = 50] = \"StringFormat\";\n  ValueErrorType[ValueErrorType[\"StringMaxLength\"] = 51] = \"StringMaxLength\";\n  ValueErrorType[ValueErrorType[\"StringMinLength\"] = 52] = \"StringMinLength\";\n  ValueErrorType[ValueErrorType[\"StringPattern\"] = 53] = \"StringPattern\";\n  ValueErrorType[ValueErrorType[\"String\"] = 54] = \"String\";\n  ValueErrorType[ValueErrorType[\"Symbol\"] = 55] = \"Symbol\";\n  ValueErrorType[ValueErrorType[\"TupleLength\"] = 56] = \"TupleLength\";\n  ValueErrorType[ValueErrorType[\"Tuple\"] = 57] = \"Tuple\";\n  ValueErrorType[ValueErrorType[\"Uint8ArrayMaxByteLength\"] = 58] = \"Uint8ArrayMaxByteLength\";\n  ValueErrorType[ValueErrorType[\"Uint8ArrayMinByteLength\"] = 59] = \"Uint8ArrayMinByteLength\";\n  ValueErrorType[ValueErrorType[\"Uint8Array\"] = 60] = \"Uint8Array\";\n  ValueErrorType[ValueErrorType[\"Undefined\"] = 61] = \"Undefined\";\n  ValueErrorType[ValueErrorType[\"Union\"] = 62] = \"Union\";\n  ValueErrorType[ValueErrorType[\"Void\"] = 63] = \"Void\";\n})(ValueErrorType || (exports.ValueErrorType = ValueErrorType = {}));\n// ------------------------------------------------------------------\n// ValueErrors\n// ------------------------------------------------------------------\nvar ValueErrorsUnknownTypeError = /*#__PURE__*/function (_index_4$TypeBoxError) {\n  function ValueErrorsUnknownTypeError(schema) {\n    var _this;\n    _classCallCheck(this, ValueErrorsUnknownTypeError);\n    _this = _callSuper(this, ValueErrorsUnknownTypeError, ['Unknown type']);\n    _this.schema = schema;\n    return _this;\n  }\n  _inherits(ValueErrorsUnknownTypeError, _index_4$TypeBoxError);\n  return _createClass(ValueErrorsUnknownTypeError);\n}(index_4.TypeBoxError);\nexports.ValueErrorsUnknownTypeError = ValueErrorsUnknownTypeError;\n// ------------------------------------------------------------------\n// EscapeKey\n// ------------------------------------------------------------------\nfunction EscapeKey(key) {\n  return key.replace(/~/g, '~0').replace(/\\//g, '~1'); // RFC6901 Path\n}\n// ------------------------------------------------------------------\n// Guards\n// ------------------------------------------------------------------\nfunction IsDefined(value) {\n  return value !== undefined;\n}\n// ------------------------------------------------------------------\n// ValueErrorIterator\n// ------------------------------------------------------------------\nvar ValueErrorIterator = /*#__PURE__*/function () {\n  function ValueErrorIterator(iterator) {\n    _classCallCheck(this, ValueErrorIterator);\n    this.iterator = iterator;\n  }\n  return _createClass(ValueErrorIterator, [{\n    key: Symbol.iterator,\n    value: function value() {\n      return this.iterator;\n    }\n    /** Returns the first value error or undefined if no errors */\n  }, {\n    key: \"First\",\n    value: function First() {\n      var next = this.iterator.next();\n      return next.done ? undefined : next.value;\n    }\n  }]);\n}();\nexports.ValueErrorIterator = ValueErrorIterator;\n// --------------------------------------------------------------------------\n// Create\n// --------------------------------------------------------------------------\nfunction Create(errorType, schema, path, value) {\n  var errors = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];\n  return {\n    type: errorType,\n    schema: schema,\n    path: path,\n    value: value,\n    message: (0, function_1.GetErrorFunction)()({\n      errorType: errorType,\n      path: path,\n      schema: schema,\n      value: value,\n      errors: errors\n    }),\n    errors: errors\n  };\n}\n// --------------------------------------------------------------------------\n// Types\n// --------------------------------------------------------------------------\nfunction FromAny(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromAny$(_context) {\n    while (1) switch (_context.prev = _context.next) {\n      case 0:\n      case \"end\":\n        return _context.stop();\n    }\n  }, _marked);\n}\nfunction FromArgument(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromArgument$(_context2) {\n    while (1) switch (_context2.prev = _context2.next) {\n      case 0:\n      case \"end\":\n        return _context2.stop();\n    }\n  }, _marked2);\n}\nfunction FromArray(schema, references, path, value) {\n  var i, containsSchema, containsCount;\n  return _regeneratorRuntime().wrap(function FromArray$(_context3) {\n    while (1) switch (_context3.prev = _context3.next) {\n      case 0:\n        if ((0, index_10.IsArray)(value)) {\n          _context3.next = 4;\n          break;\n        }\n        _context3.next = 3;\n        return Create(ValueErrorType.Array, schema, path, value);\n      case 3:\n        return _context3.abrupt(\"return\", _context3.sent);\n      case 4:\n        if (!(IsDefined(schema.minItems) && !(value.length >= schema.minItems))) {\n          _context3.next = 7;\n          break;\n        }\n        _context3.next = 7;\n        return Create(ValueErrorType.ArrayMinItems, schema, path, value);\n      case 7:\n        if (!(IsDefined(schema.maxItems) && !(value.length <= schema.maxItems))) {\n          _context3.next = 10;\n          break;\n        }\n        _context3.next = 10;\n        return Create(ValueErrorType.ArrayMaxItems, schema, path, value);\n      case 10:\n        i = 0;\n      case 11:\n        if (!(i < value.length)) {\n          _context3.next = 16;\n          break;\n        }\n        return _context3.delegateYield(Visit(schema.items, references, \"\".concat(path, \"/\").concat(i), value[i]), \"t0\", 13);\n      case 13:\n        i++;\n        _context3.next = 11;\n        break;\n      case 16:\n        if (!(schema.uniqueItems === true && !function () {\n          var set = new Set();\n          var _iterator = _createForOfIteratorHelper(value),\n            _step;\n          try {\n            for (_iterator.s(); !(_step = _iterator.n()).done;) {\n              var element = _step.value;\n              var hashed = (0, index_6.Hash)(element);\n              if (set.has(hashed)) {\n                return false;\n              } else {\n                set.add(hashed);\n              }\n            }\n          } catch (err) {\n            _iterator.e(err);\n          } finally {\n            _iterator.f();\n          }\n          return true;\n        }())) {\n          _context3.next = 19;\n          break;\n        }\n        _context3.next = 19;\n        return Create(ValueErrorType.ArrayUniqueItems, schema, path, value);\n      case 19:\n        if (IsDefined(schema.contains) || IsDefined(schema.minContains) || IsDefined(schema.maxContains)) {\n          _context3.next = 21;\n          break;\n        }\n        return _context3.abrupt(\"return\");\n      case 21:\n        containsSchema = IsDefined(schema.contains) ? schema.contains : (0, index_9.Never)();\n        containsCount = value.reduce(function (acc, value, index) {\n          return Visit(containsSchema, references, \"\".concat(path).concat(index), value).next().done === true ? acc + 1 : acc;\n        }, 0);\n        if (!(containsCount === 0)) {\n          _context3.next = 26;\n          break;\n        }\n        _context3.next = 26;\n        return Create(ValueErrorType.ArrayContains, schema, path, value);\n      case 26:\n        if (!((0, index_10.IsNumber)(schema.minContains) && containsCount < schema.minContains)) {\n          _context3.next = 29;\n          break;\n        }\n        _context3.next = 29;\n        return Create(ValueErrorType.ArrayMinContains, schema, path, value);\n      case 29:\n        if (!((0, index_10.IsNumber)(schema.maxContains) && containsCount > schema.maxContains)) {\n          _context3.next = 32;\n          break;\n        }\n        _context3.next = 32;\n        return Create(ValueErrorType.ArrayMaxContains, schema, path, value);\n      case 32:\n      case \"end\":\n        return _context3.stop();\n    }\n  }, _marked3);\n}\nfunction FromAsyncIterator(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromAsyncIterator$(_context4) {\n    while (1) switch (_context4.prev = _context4.next) {\n      case 0:\n        if ((0, index_10.IsAsyncIterator)(value)) {\n          _context4.next = 3;\n          break;\n        }\n        _context4.next = 3;\n        return Create(ValueErrorType.AsyncIterator, schema, path, value);\n      case 3:\n      case \"end\":\n        return _context4.stop();\n    }\n  }, _marked4);\n}\nfunction FromBigInt(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromBigInt$(_context5) {\n    while (1) switch (_context5.prev = _context5.next) {\n      case 0:\n        if ((0, index_10.IsBigInt)(value)) {\n          _context5.next = 4;\n          break;\n        }\n        _context5.next = 3;\n        return Create(ValueErrorType.BigInt, schema, path, value);\n      case 3:\n        return _context5.abrupt(\"return\", _context5.sent);\n      case 4:\n        if (!(IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum))) {\n          _context5.next = 7;\n          break;\n        }\n        _context5.next = 7;\n        return Create(ValueErrorType.BigIntExclusiveMaximum, schema, path, value);\n      case 7:\n        if (!(IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum))) {\n          _context5.next = 10;\n          break;\n        }\n        _context5.next = 10;\n        return Create(ValueErrorType.BigIntExclusiveMinimum, schema, path, value);\n      case 10:\n        if (!(IsDefined(schema.maximum) && !(value <= schema.maximum))) {\n          _context5.next = 13;\n          break;\n        }\n        _context5.next = 13;\n        return Create(ValueErrorType.BigIntMaximum, schema, path, value);\n      case 13:\n        if (!(IsDefined(schema.minimum) && !(value >= schema.minimum))) {\n          _context5.next = 16;\n          break;\n        }\n        _context5.next = 16;\n        return Create(ValueErrorType.BigIntMinimum, schema, path, value);\n      case 16:\n        if (!(IsDefined(schema.multipleOf) && !(value % schema.multipleOf === BigInt(0)))) {\n          _context5.next = 19;\n          break;\n        }\n        _context5.next = 19;\n        return Create(ValueErrorType.BigIntMultipleOf, schema, path, value);\n      case 19:\n      case \"end\":\n        return _context5.stop();\n    }\n  }, _marked5);\n}\nfunction FromBoolean(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromBoolean$(_context6) {\n    while (1) switch (_context6.prev = _context6.next) {\n      case 0:\n        if ((0, index_10.IsBoolean)(value)) {\n          _context6.next = 3;\n          break;\n        }\n        _context6.next = 3;\n        return Create(ValueErrorType.Boolean, schema, path, value);\n      case 3:\n      case \"end\":\n        return _context6.stop();\n    }\n  }, _marked6);\n}\nfunction FromConstructor(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromConstructor$(_context7) {\n    while (1) switch (_context7.prev = _context7.next) {\n      case 0:\n        return _context7.delegateYield(Visit(schema.returns, references, path, value.prototype), \"t0\", 1);\n      case 1:\n      case \"end\":\n        return _context7.stop();\n    }\n  }, _marked7);\n}\nfunction FromDate(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromDate$(_context8) {\n    while (1) switch (_context8.prev = _context8.next) {\n      case 0:\n        if ((0, index_10.IsDate)(value)) {\n          _context8.next = 4;\n          break;\n        }\n        _context8.next = 3;\n        return Create(ValueErrorType.Date, schema, path, value);\n      case 3:\n        return _context8.abrupt(\"return\", _context8.sent);\n      case 4:\n        if (!(IsDefined(schema.exclusiveMaximumTimestamp) && !(value.getTime() < schema.exclusiveMaximumTimestamp))) {\n          _context8.next = 7;\n          break;\n        }\n        _context8.next = 7;\n        return Create(ValueErrorType.DateExclusiveMaximumTimestamp, schema, path, value);\n      case 7:\n        if (!(IsDefined(schema.exclusiveMinimumTimestamp) && !(value.getTime() > schema.exclusiveMinimumTimestamp))) {\n          _context8.next = 10;\n          break;\n        }\n        _context8.next = 10;\n        return Create(ValueErrorType.DateExclusiveMinimumTimestamp, schema, path, value);\n      case 10:\n        if (!(IsDefined(schema.maximumTimestamp) && !(value.getTime() <= schema.maximumTimestamp))) {\n          _context8.next = 13;\n          break;\n        }\n        _context8.next = 13;\n        return Create(ValueErrorType.DateMaximumTimestamp, schema, path, value);\n      case 13:\n        if (!(IsDefined(schema.minimumTimestamp) && !(value.getTime() >= schema.minimumTimestamp))) {\n          _context8.next = 16;\n          break;\n        }\n        _context8.next = 16;\n        return Create(ValueErrorType.DateMinimumTimestamp, schema, path, value);\n      case 16:\n        if (!(IsDefined(schema.multipleOfTimestamp) && !(value.getTime() % schema.multipleOfTimestamp === 0))) {\n          _context8.next = 19;\n          break;\n        }\n        _context8.next = 19;\n        return Create(ValueErrorType.DateMultipleOfTimestamp, schema, path, value);\n      case 19:\n      case \"end\":\n        return _context8.stop();\n    }\n  }, _marked8);\n}\nfunction FromFunction(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromFunction$(_context9) {\n    while (1) switch (_context9.prev = _context9.next) {\n      case 0:\n        if ((0, index_10.IsFunction)(value)) {\n          _context9.next = 3;\n          break;\n        }\n        _context9.next = 3;\n        return Create(ValueErrorType.Function, schema, path, value);\n      case 3:\n      case \"end\":\n        return _context9.stop();\n    }\n  }, _marked9);\n}\nfunction FromImport(schema, references, path, value) {\n  var definitions, target;\n  return _regeneratorRuntime().wrap(function FromImport$(_context10) {\n    while (1) switch (_context10.prev = _context10.next) {\n      case 0:\n        definitions = globalThis.Object.values(schema.$defs);\n        target = schema.$defs[schema.$ref];\n        return _context10.delegateYield(Visit(target, [].concat(_toConsumableArray(references), _toConsumableArray(definitions)), path, value), \"t0\", 3);\n      case 3:\n      case \"end\":\n        return _context10.stop();\n    }\n  }, _marked10);\n}\nfunction FromInteger(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromInteger$(_context11) {\n    while (1) switch (_context11.prev = _context11.next) {\n      case 0:\n        if ((0, index_10.IsInteger)(value)) {\n          _context11.next = 4;\n          break;\n        }\n        _context11.next = 3;\n        return Create(ValueErrorType.Integer, schema, path, value);\n      case 3:\n        return _context11.abrupt(\"return\", _context11.sent);\n      case 4:\n        if (!(IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum))) {\n          _context11.next = 7;\n          break;\n        }\n        _context11.next = 7;\n        return Create(ValueErrorType.IntegerExclusiveMaximum, schema, path, value);\n      case 7:\n        if (!(IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum))) {\n          _context11.next = 10;\n          break;\n        }\n        _context11.next = 10;\n        return Create(ValueErrorType.IntegerExclusiveMinimum, schema, path, value);\n      case 10:\n        if (!(IsDefined(schema.maximum) && !(value <= schema.maximum))) {\n          _context11.next = 13;\n          break;\n        }\n        _context11.next = 13;\n        return Create(ValueErrorType.IntegerMaximum, schema, path, value);\n      case 13:\n        if (!(IsDefined(schema.minimum) && !(value >= schema.minimum))) {\n          _context11.next = 16;\n          break;\n        }\n        _context11.next = 16;\n        return Create(ValueErrorType.IntegerMinimum, schema, path, value);\n      case 16:\n        if (!(IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0))) {\n          _context11.next = 19;\n          break;\n        }\n        _context11.next = 19;\n        return Create(ValueErrorType.IntegerMultipleOf, schema, path, value);\n      case 19:\n      case \"end\":\n        return _context11.stop();\n    }\n  }, _marked11);\n}\nfunction FromIntersect(schema, references, path, value) {\n  var hasError, _iterator2, _step2, inner, _iterator5, _step5, error, keyCheck, _iterator3, _step3, valueKey, _keyCheck, _iterator4, _step4, _valueKey, next;\n  return _regeneratorRuntime().wrap(function FromIntersect$(_context12) {\n    while (1) switch (_context12.prev = _context12.next) {\n      case 0:\n        hasError = false;\n        _iterator2 = _createForOfIteratorHelper(schema.allOf);\n        _context12.prev = 2;\n        _iterator2.s();\n      case 4:\n        if ((_step2 = _iterator2.n()).done) {\n          _context12.next = 26;\n          break;\n        }\n        inner = _step2.value;\n        _iterator5 = _createForOfIteratorHelper(Visit(inner, references, path, value));\n        _context12.prev = 7;\n        _iterator5.s();\n      case 9:\n        if ((_step5 = _iterator5.n()).done) {\n          _context12.next = 16;\n          break;\n        }\n        error = _step5.value;\n        hasError = true;\n        _context12.next = 14;\n        return error;\n      case 14:\n        _context12.next = 9;\n        break;\n      case 16:\n        _context12.next = 21;\n        break;\n      case 18:\n        _context12.prev = 18;\n        _context12.t0 = _context12[\"catch\"](7);\n        _iterator5.e(_context12.t0);\n      case 21:\n        _context12.prev = 21;\n        _iterator5.f();\n        return _context12.finish(21);\n      case 24:\n        _context12.next = 4;\n        break;\n      case 26:\n        _context12.next = 31;\n        break;\n      case 28:\n        _context12.prev = 28;\n        _context12.t1 = _context12[\"catch\"](2);\n        _iterator2.e(_context12.t1);\n      case 31:\n        _context12.prev = 31;\n        _iterator2.f();\n        return _context12.finish(31);\n      case 34:\n        if (!hasError) {\n          _context12.next = 38;\n          break;\n        }\n        _context12.next = 37;\n        return Create(ValueErrorType.Intersect, schema, path, value);\n      case 37:\n        return _context12.abrupt(\"return\", _context12.sent);\n      case 38:\n        if (!(schema.unevaluatedProperties === false)) {\n          _context12.next = 58;\n          break;\n        }\n        keyCheck = new RegExp((0, index_2.KeyOfPattern)(schema));\n        _iterator3 = _createForOfIteratorHelper(Object.getOwnPropertyNames(value));\n        _context12.prev = 41;\n        _iterator3.s();\n      case 43:\n        if ((_step3 = _iterator3.n()).done) {\n          _context12.next = 50;\n          break;\n        }\n        valueKey = _step3.value;\n        if (keyCheck.test(valueKey)) {\n          _context12.next = 48;\n          break;\n        }\n        _context12.next = 48;\n        return Create(ValueErrorType.IntersectUnevaluatedProperties, schema, \"\".concat(path, \"/\").concat(valueKey), value);\n      case 48:\n        _context12.next = 43;\n        break;\n      case 50:\n        _context12.next = 55;\n        break;\n      case 52:\n        _context12.prev = 52;\n        _context12.t2 = _context12[\"catch\"](41);\n        _iterator3.e(_context12.t2);\n      case 55:\n        _context12.prev = 55;\n        _iterator3.f();\n        return _context12.finish(55);\n      case 58:\n        if (!(_typeof(schema.unevaluatedProperties) === 'object')) {\n          _context12.next = 80;\n          break;\n        }\n        _keyCheck = new RegExp((0, index_2.KeyOfPattern)(schema));\n        _iterator4 = _createForOfIteratorHelper(Object.getOwnPropertyNames(value));\n        _context12.prev = 61;\n        _iterator4.s();\n      case 63:\n        if ((_step4 = _iterator4.n()).done) {\n          _context12.next = 72;\n          break;\n        }\n        _valueKey = _step4.value;\n        if (_keyCheck.test(_valueKey)) {\n          _context12.next = 70;\n          break;\n        }\n        next = Visit(schema.unevaluatedProperties, references, \"\".concat(path, \"/\").concat(_valueKey), value[_valueKey]).next();\n        if (next.done) {\n          _context12.next = 70;\n          break;\n        }\n        _context12.next = 70;\n        return next.value;\n      case 70:\n        _context12.next = 63;\n        break;\n      case 72:\n        _context12.next = 77;\n        break;\n      case 74:\n        _context12.prev = 74;\n        _context12.t3 = _context12[\"catch\"](61);\n        _iterator4.e(_context12.t3);\n      case 77:\n        _context12.prev = 77;\n        _iterator4.f();\n        return _context12.finish(77);\n      case 80:\n      case \"end\":\n        return _context12.stop();\n    }\n  }, _marked12, null, [[2, 28, 31, 34], [7, 18, 21, 24], [41, 52, 55, 58], [61, 74, 77, 80]]);\n}\nfunction FromIterator(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromIterator$(_context13) {\n    while (1) switch (_context13.prev = _context13.next) {\n      case 0:\n        if ((0, index_10.IsIterator)(value)) {\n          _context13.next = 3;\n          break;\n        }\n        _context13.next = 3;\n        return Create(ValueErrorType.Iterator, schema, path, value);\n      case 3:\n      case \"end\":\n        return _context13.stop();\n    }\n  }, _marked13);\n}\nfunction FromLiteral(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromLiteral$(_context14) {\n    while (1) switch (_context14.prev = _context14.next) {\n      case 0:\n        if (value === schema[\"const\"]) {\n          _context14.next = 3;\n          break;\n        }\n        _context14.next = 3;\n        return Create(ValueErrorType.Literal, schema, path, value);\n      case 3:\n      case \"end\":\n        return _context14.stop();\n    }\n  }, _marked14);\n}\nfunction FromNever(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromNever$(_context15) {\n    while (1) switch (_context15.prev = _context15.next) {\n      case 0:\n        _context15.next = 2;\n        return Create(ValueErrorType.Never, schema, path, value);\n      case 2:\n      case \"end\":\n        return _context15.stop();\n    }\n  }, _marked15);\n}\nfunction FromNot(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromNot$(_context16) {\n    while (1) switch (_context16.prev = _context16.next) {\n      case 0:\n        if (!(Visit(schema.not, references, path, value).next().done === true)) {\n          _context16.next = 3;\n          break;\n        }\n        _context16.next = 3;\n        return Create(ValueErrorType.Not, schema, path, value);\n      case 3:\n      case \"end\":\n        return _context16.stop();\n    }\n  }, _marked16);\n}\nfunction FromNull(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromNull$(_context17) {\n    while (1) switch (_context17.prev = _context17.next) {\n      case 0:\n        if ((0, index_10.IsNull)(value)) {\n          _context17.next = 3;\n          break;\n        }\n        _context17.next = 3;\n        return Create(ValueErrorType.Null, schema, path, value);\n      case 3:\n      case \"end\":\n        return _context17.stop();\n    }\n  }, _marked17);\n}\nfunction FromNumber(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromNumber$(_context18) {\n    while (1) switch (_context18.prev = _context18.next) {\n      case 0:\n        if (index_1.TypeSystemPolicy.IsNumberLike(value)) {\n          _context18.next = 4;\n          break;\n        }\n        _context18.next = 3;\n        return Create(ValueErrorType.Number, schema, path, value);\n      case 3:\n        return _context18.abrupt(\"return\", _context18.sent);\n      case 4:\n        if (!(IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum))) {\n          _context18.next = 7;\n          break;\n        }\n        _context18.next = 7;\n        return Create(ValueErrorType.NumberExclusiveMaximum, schema, path, value);\n      case 7:\n        if (!(IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum))) {\n          _context18.next = 10;\n          break;\n        }\n        _context18.next = 10;\n        return Create(ValueErrorType.NumberExclusiveMinimum, schema, path, value);\n      case 10:\n        if (!(IsDefined(schema.maximum) && !(value <= schema.maximum))) {\n          _context18.next = 13;\n          break;\n        }\n        _context18.next = 13;\n        return Create(ValueErrorType.NumberMaximum, schema, path, value);\n      case 13:\n        if (!(IsDefined(schema.minimum) && !(value >= schema.minimum))) {\n          _context18.next = 16;\n          break;\n        }\n        _context18.next = 16;\n        return Create(ValueErrorType.NumberMinimum, schema, path, value);\n      case 16:\n        if (!(IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0))) {\n          _context18.next = 19;\n          break;\n        }\n        _context18.next = 19;\n        return Create(ValueErrorType.NumberMultipleOf, schema, path, value);\n      case 19:\n      case \"end\":\n        return _context18.stop();\n    }\n  }, _marked18);\n}\nfunction FromObject(schema, references, path, value) {\n  var requiredKeys, knownKeys, unknownKeys, _iterator6, _step6, requiredKey, _iterator7, _step7, valueKey, _iterator8, _step8, _valueKey2, _iterator9, _step9, knownKey, property;\n  return _regeneratorRuntime().wrap(function FromObject$(_context19) {\n    while (1) switch (_context19.prev = _context19.next) {\n      case 0:\n        if (index_1.TypeSystemPolicy.IsObjectLike(value)) {\n          _context19.next = 4;\n          break;\n        }\n        _context19.next = 3;\n        return Create(ValueErrorType.Object, schema, path, value);\n      case 3:\n        return _context19.abrupt(\"return\", _context19.sent);\n      case 4:\n        if (!(IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties))) {\n          _context19.next = 7;\n          break;\n        }\n        _context19.next = 7;\n        return Create(ValueErrorType.ObjectMinProperties, schema, path, value);\n      case 7:\n        if (!(IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties))) {\n          _context19.next = 10;\n          break;\n        }\n        _context19.next = 10;\n        return Create(ValueErrorType.ObjectMaxProperties, schema, path, value);\n      case 10:\n        requiredKeys = Array.isArray(schema.required) ? schema.required : [];\n        knownKeys = Object.getOwnPropertyNames(schema.properties);\n        unknownKeys = Object.getOwnPropertyNames(value);\n        _iterator6 = _createForOfIteratorHelper(requiredKeys);\n        _context19.prev = 14;\n        _iterator6.s();\n      case 16:\n        if ((_step6 = _iterator6.n()).done) {\n          _context19.next = 24;\n          break;\n        }\n        requiredKey = _step6.value;\n        if (!unknownKeys.includes(requiredKey)) {\n          _context19.next = 20;\n          break;\n        }\n        return _context19.abrupt(\"continue\", 22);\n      case 20:\n        _context19.next = 22;\n        return Create(ValueErrorType.ObjectRequiredProperty, schema.properties[requiredKey], \"\".concat(path, \"/\").concat(EscapeKey(requiredKey)), undefined);\n      case 22:\n        _context19.next = 16;\n        break;\n      case 24:\n        _context19.next = 29;\n        break;\n      case 26:\n        _context19.prev = 26;\n        _context19.t0 = _context19[\"catch\"](14);\n        _iterator6.e(_context19.t0);\n      case 29:\n        _context19.prev = 29;\n        _iterator6.f();\n        return _context19.finish(29);\n      case 32:\n        if (!(schema.additionalProperties === false)) {\n          _context19.next = 51;\n          break;\n        }\n        _iterator7 = _createForOfIteratorHelper(unknownKeys);\n        _context19.prev = 34;\n        _iterator7.s();\n      case 36:\n        if ((_step7 = _iterator7.n()).done) {\n          _context19.next = 43;\n          break;\n        }\n        valueKey = _step7.value;\n        if (knownKeys.includes(valueKey)) {\n          _context19.next = 41;\n          break;\n        }\n        _context19.next = 41;\n        return Create(ValueErrorType.ObjectAdditionalProperties, schema, \"\".concat(path, \"/\").concat(EscapeKey(valueKey)), value[valueKey]);\n      case 41:\n        _context19.next = 36;\n        break;\n      case 43:\n        _context19.next = 48;\n        break;\n      case 45:\n        _context19.prev = 45;\n        _context19.t1 = _context19[\"catch\"](34);\n        _iterator7.e(_context19.t1);\n      case 48:\n        _context19.prev = 48;\n        _iterator7.f();\n        return _context19.finish(48);\n      case 51:\n        if (!(_typeof(schema.additionalProperties) === 'object')) {\n          _context19.next = 70;\n          break;\n        }\n        _iterator8 = _createForOfIteratorHelper(unknownKeys);\n        _context19.prev = 53;\n        _iterator8.s();\n      case 55:\n        if ((_step8 = _iterator8.n()).done) {\n          _context19.next = 62;\n          break;\n        }\n        _valueKey2 = _step8.value;\n        if (!knownKeys.includes(_valueKey2)) {\n          _context19.next = 59;\n          break;\n        }\n        return _context19.abrupt(\"continue\", 60);\n      case 59:\n        return _context19.delegateYield(Visit(schema.additionalProperties, references, \"\".concat(path, \"/\").concat(EscapeKey(_valueKey2)), value[_valueKey2]), \"t2\", 60);\n      case 60:\n        _context19.next = 55;\n        break;\n      case 62:\n        _context19.next = 67;\n        break;\n      case 64:\n        _context19.prev = 64;\n        _context19.t3 = _context19[\"catch\"](53);\n        _iterator8.e(_context19.t3);\n      case 67:\n        _context19.prev = 67;\n        _iterator8.f();\n        return _context19.finish(67);\n      case 70:\n        _iterator9 = _createForOfIteratorHelper(knownKeys);\n        _context19.prev = 71;\n        _iterator9.s();\n      case 73:\n        if ((_step9 = _iterator9.n()).done) {\n          _context19.next = 87;\n          break;\n        }\n        knownKey = _step9.value;\n        property = schema.properties[knownKey];\n        if (!(schema.required && schema.required.includes(knownKey))) {\n          _context19.next = 83;\n          break;\n        }\n        return _context19.delegateYield(Visit(property, references, \"\".concat(path, \"/\").concat(EscapeKey(knownKey)), value[knownKey]), \"t4\", 78);\n      case 78:\n        if (!((0, extends_undefined_1.ExtendsUndefinedCheck)(schema) && !(knownKey in value))) {\n          _context19.next = 81;\n          break;\n        }\n        _context19.next = 81;\n        return Create(ValueErrorType.ObjectRequiredProperty, property, \"\".concat(path, \"/\").concat(EscapeKey(knownKey)), undefined);\n      case 81:\n        _context19.next = 85;\n        break;\n      case 83:\n        if (!index_1.TypeSystemPolicy.IsExactOptionalProperty(value, knownKey)) {\n          _context19.next = 85;\n          break;\n        }\n        return _context19.delegateYield(Visit(property, references, \"\".concat(path, \"/\").concat(EscapeKey(knownKey)), value[knownKey]), \"t5\", 85);\n      case 85:\n        _context19.next = 73;\n        break;\n      case 87:\n        _context19.next = 92;\n        break;\n      case 89:\n        _context19.prev = 89;\n        _context19.t6 = _context19[\"catch\"](71);\n        _iterator9.e(_context19.t6);\n      case 92:\n        _context19.prev = 92;\n        _iterator9.f();\n        return _context19.finish(92);\n      case 95:\n      case \"end\":\n        return _context19.stop();\n    }\n  }, _marked19, null, [[14, 26, 29, 32], [34, 45, 48, 51], [53, 64, 67, 70], [71, 89, 92, 95]]);\n}\nfunction FromPromise(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromPromise$(_context20) {\n    while (1) switch (_context20.prev = _context20.next) {\n      case 0:\n        if ((0, index_10.IsPromise)(value)) {\n          _context20.next = 3;\n          break;\n        }\n        _context20.next = 3;\n        return Create(ValueErrorType.Promise, schema, path, value);\n      case 3:\n      case \"end\":\n        return _context20.stop();\n    }\n  }, _marked20);\n}\nfunction FromRecord(schema, references, path, value) {\n  var _Object$entries$, patternKey, patternSchema, regex, _i, _Object$entries, _Object$entries$_i, propertyKey, propertyValue, _i2, _Object$entries2, _Object$entries2$_i, _propertyKey, _propertyValue, _i3, _Object$entries3, _Object$entries3$_i, _propertyKey2, _propertyValue2;\n  return _regeneratorRuntime().wrap(function FromRecord$(_context21) {\n    while (1) switch (_context21.prev = _context21.next) {\n      case 0:\n        if (index_1.TypeSystemPolicy.IsRecordLike(value)) {\n          _context21.next = 4;\n          break;\n        }\n        _context21.next = 3;\n        return Create(ValueErrorType.Object, schema, path, value);\n      case 3:\n        return _context21.abrupt(\"return\", _context21.sent);\n      case 4:\n        if (!(IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties))) {\n          _context21.next = 7;\n          break;\n        }\n        _context21.next = 7;\n        return Create(ValueErrorType.ObjectMinProperties, schema, path, value);\n      case 7:\n        if (!(IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties))) {\n          _context21.next = 10;\n          break;\n        }\n        _context21.next = 10;\n        return Create(ValueErrorType.ObjectMaxProperties, schema, path, value);\n      case 10:\n        _Object$entries$ = _slicedToArray(Object.entries(schema.patternProperties)[0], 2), patternKey = _Object$entries$[0], patternSchema = _Object$entries$[1];\n        regex = new RegExp(patternKey);\n        _i = 0, _Object$entries = Object.entries(value);\n      case 13:\n        if (!(_i < _Object$entries.length)) {\n          _context21.next = 20;\n          break;\n        }\n        _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2), propertyKey = _Object$entries$_i[0], propertyValue = _Object$entries$_i[1];\n        if (!regex.test(propertyKey)) {\n          _context21.next = 17;\n          break;\n        }\n        return _context21.delegateYield(Visit(patternSchema, references, \"\".concat(path, \"/\").concat(EscapeKey(propertyKey)), propertyValue), \"t0\", 17);\n      case 17:\n        _i++;\n        _context21.next = 13;\n        break;\n      case 20:\n        if (!(_typeof(schema.additionalProperties) === 'object')) {\n          _context21.next = 29;\n          break;\n        }\n        _i2 = 0, _Object$entries2 = Object.entries(value);\n      case 22:\n        if (!(_i2 < _Object$entries2.length)) {\n          _context21.next = 29;\n          break;\n        }\n        _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2), _propertyKey = _Object$entries2$_i[0], _propertyValue = _Object$entries2$_i[1];\n        if (regex.test(_propertyKey)) {\n          _context21.next = 26;\n          break;\n        }\n        return _context21.delegateYield(Visit(schema.additionalProperties, references, \"\".concat(path, \"/\").concat(EscapeKey(_propertyKey)), _propertyValue), \"t1\", 26);\n      case 26:\n        _i2++;\n        _context21.next = 22;\n        break;\n      case 29:\n        if (!(schema.additionalProperties === false)) {\n          _context21.next = 41;\n          break;\n        }\n        _i3 = 0, _Object$entries3 = Object.entries(value);\n      case 31:\n        if (!(_i3 < _Object$entries3.length)) {\n          _context21.next = 41;\n          break;\n        }\n        _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2), _propertyKey2 = _Object$entries3$_i[0], _propertyValue2 = _Object$entries3$_i[1];\n        if (!regex.test(_propertyKey2)) {\n          _context21.next = 35;\n          break;\n        }\n        return _context21.abrupt(\"continue\", 38);\n      case 35:\n        _context21.next = 37;\n        return Create(ValueErrorType.ObjectAdditionalProperties, schema, \"\".concat(path, \"/\").concat(EscapeKey(_propertyKey2)), _propertyValue2);\n      case 37:\n        return _context21.abrupt(\"return\", _context21.sent);\n      case 38:\n        _i3++;\n        _context21.next = 31;\n        break;\n      case 41:\n      case \"end\":\n        return _context21.stop();\n    }\n  }, _marked21);\n}\nfunction FromRef(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromRef$(_context22) {\n    while (1) switch (_context22.prev = _context22.next) {\n      case 0:\n        return _context22.delegateYield(Visit((0, index_5.Deref)(schema, references), references, path, value), \"t0\", 1);\n      case 1:\n      case \"end\":\n        return _context22.stop();\n    }\n  }, _marked22);\n}\nfunction FromRegExp(schema, references, path, value) {\n  var regex;\n  return _regeneratorRuntime().wrap(function FromRegExp$(_context23) {\n    while (1) switch (_context23.prev = _context23.next) {\n      case 0:\n        if ((0, index_10.IsString)(value)) {\n          _context23.next = 4;\n          break;\n        }\n        _context23.next = 3;\n        return Create(ValueErrorType.String, schema, path, value);\n      case 3:\n        return _context23.abrupt(\"return\", _context23.sent);\n      case 4:\n        if (!(IsDefined(schema.minLength) && !(value.length >= schema.minLength))) {\n          _context23.next = 7;\n          break;\n        }\n        _context23.next = 7;\n        return Create(ValueErrorType.StringMinLength, schema, path, value);\n      case 7:\n        if (!(IsDefined(schema.maxLength) && !(value.length <= schema.maxLength))) {\n          _context23.next = 10;\n          break;\n        }\n        _context23.next = 10;\n        return Create(ValueErrorType.StringMaxLength, schema, path, value);\n      case 10:\n        regex = new RegExp(schema.source, schema.flags);\n        if (regex.test(value)) {\n          _context23.next = 15;\n          break;\n        }\n        _context23.next = 14;\n        return Create(ValueErrorType.RegExp, schema, path, value);\n      case 14:\n        return _context23.abrupt(\"return\", _context23.sent);\n      case 15:\n      case \"end\":\n        return _context23.stop();\n    }\n  }, _marked23);\n}\nfunction FromString(schema, references, path, value) {\n  var regex, format;\n  return _regeneratorRuntime().wrap(function FromString$(_context24) {\n    while (1) switch (_context24.prev = _context24.next) {\n      case 0:\n        if ((0, index_10.IsString)(value)) {\n          _context24.next = 4;\n          break;\n        }\n        _context24.next = 3;\n        return Create(ValueErrorType.String, schema, path, value);\n      case 3:\n        return _context24.abrupt(\"return\", _context24.sent);\n      case 4:\n        if (!(IsDefined(schema.minLength) && !(value.length >= schema.minLength))) {\n          _context24.next = 7;\n          break;\n        }\n        _context24.next = 7;\n        return Create(ValueErrorType.StringMinLength, schema, path, value);\n      case 7:\n        if (!(IsDefined(schema.maxLength) && !(value.length <= schema.maxLength))) {\n          _context24.next = 10;\n          break;\n        }\n        _context24.next = 10;\n        return Create(ValueErrorType.StringMaxLength, schema, path, value);\n      case 10:\n        if (!(0, index_10.IsString)(schema.pattern)) {\n          _context24.next = 15;\n          break;\n        }\n        regex = new RegExp(schema.pattern);\n        if (regex.test(value)) {\n          _context24.next = 15;\n          break;\n        }\n        _context24.next = 15;\n        return Create(ValueErrorType.StringPattern, schema, path, value);\n      case 15:\n        if (!(0, index_10.IsString)(schema.format)) {\n          _context24.next = 25;\n          break;\n        }\n        if (index_3.FormatRegistry.Has(schema.format)) {\n          _context24.next = 21;\n          break;\n        }\n        _context24.next = 19;\n        return Create(ValueErrorType.StringFormatUnknown, schema, path, value);\n      case 19:\n        _context24.next = 25;\n        break;\n      case 21:\n        format = index_3.FormatRegistry.Get(schema.format);\n        if (format(value)) {\n          _context24.next = 25;\n          break;\n        }\n        _context24.next = 25;\n        return Create(ValueErrorType.StringFormat, schema, path, value);\n      case 25:\n      case \"end\":\n        return _context24.stop();\n    }\n  }, _marked24);\n}\nfunction FromSymbol(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromSymbol$(_context25) {\n    while (1) switch (_context25.prev = _context25.next) {\n      case 0:\n        if ((0, index_10.IsSymbol)(value)) {\n          _context25.next = 3;\n          break;\n        }\n        _context25.next = 3;\n        return Create(ValueErrorType.Symbol, schema, path, value);\n      case 3:\n      case \"end\":\n        return _context25.stop();\n    }\n  }, _marked25);\n}\nfunction FromTemplateLiteral(schema, references, path, value) {\n  var regex;\n  return _regeneratorRuntime().wrap(function FromTemplateLiteral$(_context26) {\n    while (1) switch (_context26.prev = _context26.next) {\n      case 0:\n        if ((0, index_10.IsString)(value)) {\n          _context26.next = 4;\n          break;\n        }\n        _context26.next = 3;\n        return Create(ValueErrorType.String, schema, path, value);\n      case 3:\n        return _context26.abrupt(\"return\", _context26.sent);\n      case 4:\n        regex = new RegExp(schema.pattern);\n        if (regex.test(value)) {\n          _context26.next = 8;\n          break;\n        }\n        _context26.next = 8;\n        return Create(ValueErrorType.StringPattern, schema, path, value);\n      case 8:\n      case \"end\":\n        return _context26.stop();\n    }\n  }, _marked26);\n}\nfunction FromThis(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromThis$(_context27) {\n    while (1) switch (_context27.prev = _context27.next) {\n      case 0:\n        return _context27.delegateYield(Visit((0, index_5.Deref)(schema, references), references, path, value), \"t0\", 1);\n      case 1:\n      case \"end\":\n        return _context27.stop();\n    }\n  }, _marked27);\n}\nfunction FromTuple(schema, references, path, value) {\n  var i;\n  return _regeneratorRuntime().wrap(function FromTuple$(_context28) {\n    while (1) switch (_context28.prev = _context28.next) {\n      case 0:\n        if ((0, index_10.IsArray)(value)) {\n          _context28.next = 4;\n          break;\n        }\n        _context28.next = 3;\n        return Create(ValueErrorType.Tuple, schema, path, value);\n      case 3:\n        return _context28.abrupt(\"return\", _context28.sent);\n      case 4:\n        if (!(schema.items === undefined && !(value.length === 0))) {\n          _context28.next = 8;\n          break;\n        }\n        _context28.next = 7;\n        return Create(ValueErrorType.TupleLength, schema, path, value);\n      case 7:\n        return _context28.abrupt(\"return\", _context28.sent);\n      case 8:\n        if (value.length === schema.maxItems) {\n          _context28.next = 12;\n          break;\n        }\n        _context28.next = 11;\n        return Create(ValueErrorType.TupleLength, schema, path, value);\n      case 11:\n        return _context28.abrupt(\"return\", _context28.sent);\n      case 12:\n        if (schema.items) {\n          _context28.next = 14;\n          break;\n        }\n        return _context28.abrupt(\"return\");\n      case 14:\n        i = 0;\n      case 15:\n        if (!(i < schema.items.length)) {\n          _context28.next = 20;\n          break;\n        }\n        return _context28.delegateYield(Visit(schema.items[i], references, \"\".concat(path, \"/\").concat(i), value[i]), \"t0\", 17);\n      case 17:\n        i++;\n        _context28.next = 15;\n        break;\n      case 20:\n      case \"end\":\n        return _context28.stop();\n    }\n  }, _marked28);\n}\nfunction FromUndefined(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromUndefined$(_context29) {\n    while (1) switch (_context29.prev = _context29.next) {\n      case 0:\n        if ((0, index_10.IsUndefined)(value)) {\n          _context29.next = 3;\n          break;\n        }\n        _context29.next = 3;\n        return Create(ValueErrorType.Undefined, schema, path, value);\n      case 3:\n      case \"end\":\n        return _context29.stop();\n    }\n  }, _marked29);\n}\nfunction FromUnion(schema, references, path, value) {\n  var errors;\n  return _regeneratorRuntime().wrap(function FromUnion$(_context30) {\n    while (1) switch (_context30.prev = _context30.next) {\n      case 0:\n        if (!(0, index_7.Check)(schema, references, value)) {\n          _context30.next = 2;\n          break;\n        }\n        return _context30.abrupt(\"return\");\n      case 2:\n        errors = schema.anyOf.map(function (variant) {\n          return new ValueErrorIterator(Visit(variant, references, path, value));\n        });\n        _context30.next = 5;\n        return Create(ValueErrorType.Union, schema, path, value, errors);\n      case 5:\n      case \"end\":\n        return _context30.stop();\n    }\n  }, _marked30);\n}\nfunction FromUint8Array(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromUint8Array$(_context31) {\n    while (1) switch (_context31.prev = _context31.next) {\n      case 0:\n        if ((0, index_10.IsUint8Array)(value)) {\n          _context31.next = 4;\n          break;\n        }\n        _context31.next = 3;\n        return Create(ValueErrorType.Uint8Array, schema, path, value);\n      case 3:\n        return _context31.abrupt(\"return\", _context31.sent);\n      case 4:\n        if (!(IsDefined(schema.maxByteLength) && !(value.length <= schema.maxByteLength))) {\n          _context31.next = 7;\n          break;\n        }\n        _context31.next = 7;\n        return Create(ValueErrorType.Uint8ArrayMaxByteLength, schema, path, value);\n      case 7:\n        if (!(IsDefined(schema.minByteLength) && !(value.length >= schema.minByteLength))) {\n          _context31.next = 10;\n          break;\n        }\n        _context31.next = 10;\n        return Create(ValueErrorType.Uint8ArrayMinByteLength, schema, path, value);\n      case 10:\n      case \"end\":\n        return _context31.stop();\n    }\n  }, _marked31);\n}\nfunction FromUnknown(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromUnknown$(_context32) {\n    while (1) switch (_context32.prev = _context32.next) {\n      case 0:\n      case \"end\":\n        return _context32.stop();\n    }\n  }, _marked32);\n}\nfunction FromVoid(schema, references, path, value) {\n  return _regeneratorRuntime().wrap(function FromVoid$(_context33) {\n    while (1) switch (_context33.prev = _context33.next) {\n      case 0:\n        if (index_1.TypeSystemPolicy.IsVoidLike(value)) {\n          _context33.next = 3;\n          break;\n        }\n        _context33.next = 3;\n        return Create(ValueErrorType.Void, schema, path, value);\n      case 3:\n      case \"end\":\n        return _context33.stop();\n    }\n  }, _marked33);\n}\nfunction FromKind(schema, references, path, value) {\n  var check;\n  return _regeneratorRuntime().wrap(function FromKind$(_context34) {\n    while (1) switch (_context34.prev = _context34.next) {\n      case 0:\n        check = index_3.TypeRegistry.Get(schema[index_8.Kind]);\n        if (check(schema, value)) {\n          _context34.next = 4;\n          break;\n        }\n        _context34.next = 4;\n        return Create(ValueErrorType.Kind, schema, path, value);\n      case 4:\n      case \"end\":\n        return _context34.stop();\n    }\n  }, _marked34);\n}\nfunction Visit(schema, references, path, value) {\n  var references_, schema_;\n  return _regeneratorRuntime().wrap(function Visit$(_context35) {\n    while (1) switch (_context35.prev = _context35.next) {\n      case 0:\n        references_ = IsDefined(schema.$id) ? [].concat(_toConsumableArray(references), [schema]) : references;\n        schema_ = schema;\n        _context35.t0 = schema_[index_8.Kind];\n        _context35.next = _context35.t0 === 'Any' ? 5 : _context35.t0 === 'Argument' ? 7 : _context35.t0 === 'Array' ? 9 : _context35.t0 === 'AsyncIterator' ? 11 : _context35.t0 === 'BigInt' ? 13 : _context35.t0 === 'Boolean' ? 15 : _context35.t0 === 'Constructor' ? 17 : _context35.t0 === 'Date' ? 19 : _context35.t0 === 'Function' ? 21 : _context35.t0 === 'Import' ? 23 : _context35.t0 === 'Integer' ? 25 : _context35.t0 === 'Intersect' ? 27 : _context35.t0 === 'Iterator' ? 29 : _context35.t0 === 'Literal' ? 31 : _context35.t0 === 'Never' ? 33 : _context35.t0 === 'Not' ? 35 : _context35.t0 === 'Null' ? 37 : _context35.t0 === 'Number' ? 39 : _context35.t0 === 'Object' ? 41 : _context35.t0 === 'Promise' ? 43 : _context35.t0 === 'Record' ? 45 : _context35.t0 === 'Ref' ? 47 : _context35.t0 === 'RegExp' ? 49 : _context35.t0 === 'String' ? 51 : _context35.t0 === 'Symbol' ? 53 : _context35.t0 === 'TemplateLiteral' ? 55 : _context35.t0 === 'This' ? 57 : _context35.t0 === 'Tuple' ? 59 : _context35.t0 === 'Undefined' ? 61 : _context35.t0 === 'Union' ? 63 : _context35.t0 === 'Uint8Array' ? 65 : _context35.t0 === 'Unknown' ? 67 : _context35.t0 === 'Void' ? 69 : 71;\n        break;\n      case 5:\n        return _context35.delegateYield(FromAny(schema_, references_, path, value), \"t1\", 6);\n      case 6:\n        return _context35.abrupt(\"return\", _context35.t1);\n      case 7:\n        return _context35.delegateYield(FromArgument(schema_, references_, path, value), \"t2\", 8);\n      case 8:\n        return _context35.abrupt(\"return\", _context35.t2);\n      case 9:\n        return _context35.delegateYield(FromArray(schema_, references_, path, value), \"t3\", 10);\n      case 10:\n        return _context35.abrupt(\"return\", _context35.t3);\n      case 11:\n        return _context35.delegateYield(FromAsyncIterator(schema_, references_, path, value), \"t4\", 12);\n      case 12:\n        return _context35.abrupt(\"return\", _context35.t4);\n      case 13:\n        return _context35.delegateYield(FromBigInt(schema_, references_, path, value), \"t5\", 14);\n      case 14:\n        return _context35.abrupt(\"return\", _context35.t5);\n      case 15:\n        return _context35.delegateYield(FromBoolean(schema_, references_, path, value), \"t6\", 16);\n      case 16:\n        return _context35.abrupt(\"return\", _context35.t6);\n      case 17:\n        return _context35.delegateYield(FromConstructor(schema_, references_, path, value), \"t7\", 18);\n      case 18:\n        return _context35.abrupt(\"return\", _context35.t7);\n      case 19:\n        return _context35.delegateYield(FromDate(schema_, references_, path, value), \"t8\", 20);\n      case 20:\n        return _context35.abrupt(\"return\", _context35.t8);\n      case 21:\n        return _context35.delegateYield(FromFunction(schema_, references_, path, value), \"t9\", 22);\n      case 22:\n        return _context35.abrupt(\"return\", _context35.t9);\n      case 23:\n        return _context35.delegateYield(FromImport(schema_, references_, path, value), \"t10\", 24);\n      case 24:\n        return _context35.abrupt(\"return\", _context35.t10);\n      case 25:\n        return _context35.delegateYield(FromInteger(schema_, references_, path, value), \"t11\", 26);\n      case 26:\n        return _context35.abrupt(\"return\", _context35.t11);\n      case 27:\n        return _context35.delegateYield(FromIntersect(schema_, references_, path, value), \"t12\", 28);\n      case 28:\n        return _context35.abrupt(\"return\", _context35.t12);\n      case 29:\n        return _context35.delegateYield(FromIterator(schema_, references_, path, value), \"t13\", 30);\n      case 30:\n        return _context35.abrupt(\"return\", _context35.t13);\n      case 31:\n        return _context35.delegateYield(FromLiteral(schema_, references_, path, value), \"t14\", 32);\n      case 32:\n        return _context35.abrupt(\"return\", _context35.t14);\n      case 33:\n        return _context35.delegateYield(FromNever(schema_, references_, path, value), \"t15\", 34);\n      case 34:\n        return _context35.abrupt(\"return\", _context35.t15);\n      case 35:\n        return _context35.delegateYield(FromNot(schema_, references_, path, value), \"t16\", 36);\n      case 36:\n        return _context35.abrupt(\"return\", _context35.t16);\n      case 37:\n        return _context35.delegateYield(FromNull(schema_, references_, path, value), \"t17\", 38);\n      case 38:\n        return _context35.abrupt(\"return\", _context35.t17);\n      case 39:\n        return _context35.delegateYield(FromNumber(schema_, references_, path, value), \"t18\", 40);\n      case 40:\n        return _context35.abrupt(\"return\", _context35.t18);\n      case 41:\n        return _context35.delegateYield(FromObject(schema_, references_, path, value), \"t19\", 42);\n      case 42:\n        return _context35.abrupt(\"return\", _context35.t19);\n      case 43:\n        return _context35.delegateYield(FromPromise(schema_, references_, path, value), \"t20\", 44);\n      case 44:\n        return _context35.abrupt(\"return\", _context35.t20);\n      case 45:\n        return _context35.delegateYield(FromRecord(schema_, references_, path, value), \"t21\", 46);\n      case 46:\n        return _context35.abrupt(\"return\", _context35.t21);\n      case 47:\n        return _context35.delegateYield(FromRef(schema_, references_, path, value), \"t22\", 48);\n      case 48:\n        return _context35.abrupt(\"return\", _context35.t22);\n      case 49:\n        return _context35.delegateYield(FromRegExp(schema_, references_, path, value), \"t23\", 50);\n      case 50:\n        return _context35.abrupt(\"return\", _context35.t23);\n      case 51:\n        return _context35.delegateYield(FromString(schema_, references_, path, value), \"t24\", 52);\n      case 52:\n        return _context35.abrupt(\"return\", _context35.t24);\n      case 53:\n        return _context35.delegateYield(FromSymbol(schema_, references_, path, value), \"t25\", 54);\n      case 54:\n        return _context35.abrupt(\"return\", _context35.t25);\n      case 55:\n        return _context35.delegateYield(FromTemplateLiteral(schema_, references_, path, value), \"t26\", 56);\n      case 56:\n        return _context35.abrupt(\"return\", _context35.t26);\n      case 57:\n        return _context35.delegateYield(FromThis(schema_, references_, path, value), \"t27\", 58);\n      case 58:\n        return _context35.abrupt(\"return\", _context35.t27);\n      case 59:\n        return _context35.delegateYield(FromTuple(schema_, references_, path, value), \"t28\", 60);\n      case 60:\n        return _context35.abrupt(\"return\", _context35.t28);\n      case 61:\n        return _context35.delegateYield(FromUndefined(schema_, references_, path, value), \"t29\", 62);\n      case 62:\n        return _context35.abrupt(\"return\", _context35.t29);\n      case 63:\n        return _context35.delegateYield(FromUnion(schema_, references_, path, value), \"t30\", 64);\n      case 64:\n        return _context35.abrupt(\"return\", _context35.t30);\n      case 65:\n        return _context35.delegateYield(FromUint8Array(schema_, references_, path, value), \"t31\", 66);\n      case 66:\n        return _context35.abrupt(\"return\", _context35.t31);\n      case 67:\n        return _context35.delegateYield(FromUnknown(schema_, references_, path, value), \"t32\", 68);\n      case 68:\n        return _context35.abrupt(\"return\", _context35.t32);\n      case 69:\n        return _context35.delegateYield(FromVoid(schema_, references_, path, value), \"t33\", 70);\n      case 70:\n        return _context35.abrupt(\"return\", _context35.t33);\n      case 71:\n        if (index_3.TypeRegistry.Has(schema_[index_8.Kind])) {\n          _context35.next = 73;\n          break;\n        }\n        throw new ValueErrorsUnknownTypeError(schema);\n      case 73:\n        return _context35.delegateYield(FromKind(schema_, references_, path, value), \"t34\", 74);\n      case 74:\n        return _context35.abrupt(\"return\", _context35.t34);\n      case 75:\n      case \"end\":\n        return _context35.stop();\n    }\n  }, _marked35);\n}\n/** Returns an iterator for each error in this value. */\nfunction Errors() {\n  var iterator = arguments.length === 3 ? Visit(arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1], '', arguments.length <= 2 ? undefined : arguments[2]) : Visit(arguments.length <= 0 ? undefined : arguments[0], [], '', arguments.length <= 1 ? undefined : arguments[1]);\n  return new ValueErrorIterator(iterator);\n}\n\n},{\"../system/index\":38,\"../type/error/index\":78,\"../type/extends/extends-undefined\":86,\"../type/keyof/index\":126,\"../type/never/index\":140,\"../type/registry/index\":184,\"../type/symbols/index\":204,\"../value/check/index\":238,\"../value/deref/index\":240,\"../value/guard/index\":242,\"../value/hash/index\":244,\"./function\":35}],35:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.DefaultErrorFunction = DefaultErrorFunction;\nexports.SetErrorFunction = SetErrorFunction;\nexports.GetErrorFunction = GetErrorFunction;\nvar index_1 = require(\"../type/symbols/index\");\nvar errors_1 = require(\"./errors\");\n/** Creates an error message using en-US as the default locale */\nfunction DefaultErrorFunction(error) {\n  switch (error.errorType) {\n    case errors_1.ValueErrorType.ArrayContains:\n      return 'Expected array to contain at least one matching value';\n    case errors_1.ValueErrorType.ArrayMaxContains:\n      return \"Expected array to contain no more than \".concat(error.schema.maxContains, \" matching values\");\n    case errors_1.ValueErrorType.ArrayMinContains:\n      return \"Expected array to contain at least \".concat(error.schema.minContains, \" matching values\");\n    case errors_1.ValueErrorType.ArrayMaxItems:\n      return \"Expected array length to be less or equal to \".concat(error.schema.maxItems);\n    case errors_1.ValueErrorType.ArrayMinItems:\n      return \"Expected array length to be greater or equal to \".concat(error.schema.minItems);\n    case errors_1.ValueErrorType.ArrayUniqueItems:\n      return 'Expected array elements to be unique';\n    case errors_1.ValueErrorType.Array:\n      return 'Expected array';\n    case errors_1.ValueErrorType.AsyncIterator:\n      return 'Expected AsyncIterator';\n    case errors_1.ValueErrorType.BigIntExclusiveMaximum:\n      return \"Expected bigint to be less than \".concat(error.schema.exclusiveMaximum);\n    case errors_1.ValueErrorType.BigIntExclusiveMinimum:\n      return \"Expected bigint to be greater than \".concat(error.schema.exclusiveMinimum);\n    case errors_1.ValueErrorType.BigIntMaximum:\n      return \"Expected bigint to be less or equal to \".concat(error.schema.maximum);\n    case errors_1.ValueErrorType.BigIntMinimum:\n      return \"Expected bigint to be greater or equal to \".concat(error.schema.minimum);\n    case errors_1.ValueErrorType.BigIntMultipleOf:\n      return \"Expected bigint to be a multiple of \".concat(error.schema.multipleOf);\n    case errors_1.ValueErrorType.BigInt:\n      return 'Expected bigint';\n    case errors_1.ValueErrorType.Boolean:\n      return 'Expected boolean';\n    case errors_1.ValueErrorType.DateExclusiveMinimumTimestamp:\n      return \"Expected Date timestamp to be greater than \".concat(error.schema.exclusiveMinimumTimestamp);\n    case errors_1.ValueErrorType.DateExclusiveMaximumTimestamp:\n      return \"Expected Date timestamp to be less than \".concat(error.schema.exclusiveMaximumTimestamp);\n    case errors_1.ValueErrorType.DateMinimumTimestamp:\n      return \"Expected Date timestamp to be greater or equal to \".concat(error.schema.minimumTimestamp);\n    case errors_1.ValueErrorType.DateMaximumTimestamp:\n      return \"Expected Date timestamp to be less or equal to \".concat(error.schema.maximumTimestamp);\n    case errors_1.ValueErrorType.DateMultipleOfTimestamp:\n      return \"Expected Date timestamp to be a multiple of \".concat(error.schema.multipleOfTimestamp);\n    case errors_1.ValueErrorType.Date:\n      return 'Expected Date';\n    case errors_1.ValueErrorType.Function:\n      return 'Expected function';\n    case errors_1.ValueErrorType.IntegerExclusiveMaximum:\n      return \"Expected integer to be less than \".concat(error.schema.exclusiveMaximum);\n    case errors_1.ValueErrorType.IntegerExclusiveMinimum:\n      return \"Expected integer to be greater than \".concat(error.schema.exclusiveMinimum);\n    case errors_1.ValueErrorType.IntegerMaximum:\n      return \"Expected integer to be less or equal to \".concat(error.schema.maximum);\n    case errors_1.ValueErrorType.IntegerMinimum:\n      return \"Expected integer to be greater or equal to \".concat(error.schema.minimum);\n    case errors_1.ValueErrorType.IntegerMultipleOf:\n      return \"Expected integer to be a multiple of \".concat(error.schema.multipleOf);\n    case errors_1.ValueErrorType.Integer:\n      return 'Expected integer';\n    case errors_1.ValueErrorType.IntersectUnevaluatedProperties:\n      return 'Unexpected property';\n    case errors_1.ValueErrorType.Intersect:\n      return 'Expected all values to match';\n    case errors_1.ValueErrorType.Iterator:\n      return 'Expected Iterator';\n    case errors_1.ValueErrorType.Literal:\n      return \"Expected \".concat(typeof error.schema[\"const\"] === 'string' ? \"'\".concat(error.schema[\"const\"], \"'\") : error.schema[\"const\"]);\n    case errors_1.ValueErrorType.Never:\n      return 'Never';\n    case errors_1.ValueErrorType.Not:\n      return 'Value should not match';\n    case errors_1.ValueErrorType.Null:\n      return 'Expected null';\n    case errors_1.ValueErrorType.NumberExclusiveMaximum:\n      return \"Expected number to be less than \".concat(error.schema.exclusiveMaximum);\n    case errors_1.ValueErrorType.NumberExclusiveMinimum:\n      return \"Expected number to be greater than \".concat(error.schema.exclusiveMinimum);\n    case errors_1.ValueErrorType.NumberMaximum:\n      return \"Expected number to be less or equal to \".concat(error.schema.maximum);\n    case errors_1.ValueErrorType.NumberMinimum:\n      return \"Expected number to be greater or equal to \".concat(error.schema.minimum);\n    case errors_1.ValueErrorType.NumberMultipleOf:\n      return \"Expected number to be a multiple of \".concat(error.schema.multipleOf);\n    case errors_1.ValueErrorType.Number:\n      return 'Expected number';\n    case errors_1.ValueErrorType.Object:\n      return 'Expected object';\n    case errors_1.ValueErrorType.ObjectAdditionalProperties:\n      return 'Unexpected property';\n    case errors_1.ValueErrorType.ObjectMaxProperties:\n      return \"Expected object to have no more than \".concat(error.schema.maxProperties, \" properties\");\n    case errors_1.ValueErrorType.ObjectMinProperties:\n      return \"Expected object to have at least \".concat(error.schema.minProperties, \" properties\");\n    case errors_1.ValueErrorType.ObjectRequiredProperty:\n      return 'Expected required property';\n    case errors_1.ValueErrorType.Promise:\n      return 'Expected Promise';\n    case errors_1.ValueErrorType.RegExp:\n      return 'Expected string to match regular expression';\n    case errors_1.ValueErrorType.StringFormatUnknown:\n      return \"Unknown format '\".concat(error.schema.format, \"'\");\n    case errors_1.ValueErrorType.StringFormat:\n      return \"Expected string to match '\".concat(error.schema.format, \"' format\");\n    case errors_1.ValueErrorType.StringMaxLength:\n      return \"Expected string length less or equal to \".concat(error.schema.maxLength);\n    case errors_1.ValueErrorType.StringMinLength:\n      return \"Expected string length greater or equal to \".concat(error.schema.minLength);\n    case errors_1.ValueErrorType.StringPattern:\n      return \"Expected string to match '\".concat(error.schema.pattern, \"'\");\n    case errors_1.ValueErrorType.String:\n      return 'Expected string';\n    case errors_1.ValueErrorType.Symbol:\n      return 'Expected symbol';\n    case errors_1.ValueErrorType.TupleLength:\n      return \"Expected tuple to have \".concat(error.schema.maxItems || 0, \" elements\");\n    case errors_1.ValueErrorType.Tuple:\n      return 'Expected tuple';\n    case errors_1.ValueErrorType.Uint8ArrayMaxByteLength:\n      return \"Expected byte length less or equal to \".concat(error.schema.maxByteLength);\n    case errors_1.ValueErrorType.Uint8ArrayMinByteLength:\n      return \"Expected byte length greater or equal to \".concat(error.schema.minByteLength);\n    case errors_1.ValueErrorType.Uint8Array:\n      return 'Expected Uint8Array';\n    case errors_1.ValueErrorType.Undefined:\n      return 'Expected undefined';\n    case errors_1.ValueErrorType.Union:\n      return 'Expected union value';\n    case errors_1.ValueErrorType.Void:\n      return 'Expected void';\n    case errors_1.ValueErrorType.Kind:\n      return \"Expected kind '\".concat(error.schema[index_1.Kind], \"'\");\n    default:\n      return 'Unknown error type';\n  }\n}\n/** Manages error message providers */\nvar errorFunction = DefaultErrorFunction;\n/** Sets the error function used to generate error messages. */\nfunction SetErrorFunction(callback) {\n  errorFunction = callback;\n}\n/** Gets the error function used to generate error messages */\nfunction GetErrorFunction() {\n  return errorFunction;\n}\n\n},{\"../type/symbols/index\":204,\"./errors\":34}],36:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./errors\"), exports);\n__exportStar(require(\"./function\"), exports);\n\n},{\"./errors\":34,\"./function\":35}],37:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n// ------------------------------------------------------------------\n// Infrastructure\n// ------------------------------------------------------------------\n__exportStar(require(\"./type/clone/index\"), exports);\n__exportStar(require(\"./type/create/index\"), exports);\n__exportStar(require(\"./type/error/index\"), exports);\n__exportStar(require(\"./type/guard/index\"), exports);\n__exportStar(require(\"./type/helpers/index\"), exports);\n__exportStar(require(\"./type/patterns/index\"), exports);\n__exportStar(require(\"./type/registry/index\"), exports);\n__exportStar(require(\"./type/sets/index\"), exports);\n__exportStar(require(\"./type/symbols/index\"), exports);\n// ------------------------------------------------------------------\n// Types\n// ------------------------------------------------------------------\n__exportStar(require(\"./type/any/index\"), exports);\n__exportStar(require(\"./type/array/index\"), exports);\n__exportStar(require(\"./type/argument/index\"), exports);\n__exportStar(require(\"./type/async-iterator/index\"), exports);\n__exportStar(require(\"./type/awaited/index\"), exports);\n__exportStar(require(\"./type/bigint/index\"), exports);\n__exportStar(require(\"./type/boolean/index\"), exports);\n__exportStar(require(\"./type/composite/index\"), exports);\n__exportStar(require(\"./type/const/index\"), exports);\n__exportStar(require(\"./type/constructor/index\"), exports);\n__exportStar(require(\"./type/constructor-parameters/index\"), exports);\n__exportStar(require(\"./type/date/index\"), exports);\n__exportStar(require(\"./type/enum/index\"), exports);\n__exportStar(require(\"./type/exclude/index\"), exports);\n__exportStar(require(\"./type/extends/index\"), exports);\n__exportStar(require(\"./type/extract/index\"), exports);\n__exportStar(require(\"./type/function/index\"), exports);\n__exportStar(require(\"./type/indexed/index\"), exports);\n__exportStar(require(\"./type/instance-type/index\"), exports);\n__exportStar(require(\"./type/instantiate/index\"), exports);\n__exportStar(require(\"./type/integer/index\"), exports);\n__exportStar(require(\"./type/intersect/index\"), exports);\n__exportStar(require(\"./type/iterator/index\"), exports);\n__exportStar(require(\"./type/intrinsic/index\"), exports);\n__exportStar(require(\"./type/keyof/index\"), exports);\n__exportStar(require(\"./type/literal/index\"), exports);\n__exportStar(require(\"./type/module/index\"), exports);\n__exportStar(require(\"./type/mapped/index\"), exports);\n__exportStar(require(\"./type/never/index\"), exports);\n__exportStar(require(\"./type/not/index\"), exports);\n__exportStar(require(\"./type/null/index\"), exports);\n__exportStar(require(\"./type/number/index\"), exports);\n__exportStar(require(\"./type/object/index\"), exports);\n__exportStar(require(\"./type/omit/index\"), exports);\n__exportStar(require(\"./type/optional/index\"), exports);\n__exportStar(require(\"./type/parameters/index\"), exports);\n__exportStar(require(\"./type/partial/index\"), exports);\n__exportStar(require(\"./type/pick/index\"), exports);\n__exportStar(require(\"./type/promise/index\"), exports);\n__exportStar(require(\"./type/readonly/index\"), exports);\n__exportStar(require(\"./type/readonly-optional/index\"), exports);\n__exportStar(require(\"./type/record/index\"), exports);\n__exportStar(require(\"./type/recursive/index\"), exports);\n__exportStar(require(\"./type/ref/index\"), exports);\n__exportStar(require(\"./type/regexp/index\"), exports);\n__exportStar(require(\"./type/required/index\"), exports);\n__exportStar(require(\"./type/rest/index\"), exports);\n__exportStar(require(\"./type/return-type/index\"), exports);\n__exportStar(require(\"./type/schema/index\"), exports);\n__exportStar(require(\"./type/static/index\"), exports);\n__exportStar(require(\"./type/string/index\"), exports);\n__exportStar(require(\"./type/symbol/index\"), exports);\n__exportStar(require(\"./type/template-literal/index\"), exports);\n__exportStar(require(\"./type/transform/index\"), exports);\n__exportStar(require(\"./type/tuple/index\"), exports);\n__exportStar(require(\"./type/uint8array/index\"), exports);\n__exportStar(require(\"./type/undefined/index\"), exports);\n__exportStar(require(\"./type/union/index\"), exports);\n__exportStar(require(\"./type/unknown/index\"), exports);\n__exportStar(require(\"./type/unsafe/index\"), exports);\n__exportStar(require(\"./type/void/index\"), exports);\n// ------------------------------------------------------------------\n// Type.*\n// ------------------------------------------------------------------\n__exportStar(require(\"./type/type/index\"), exports);\n\n},{\"./type/any/index\":42,\"./type/argument/index\":44,\"./type/array/index\":46,\"./type/async-iterator/index\":48,\"./type/awaited/index\":50,\"./type/bigint/index\":52,\"./type/boolean/index\":54,\"./type/clone/index\":55,\"./type/composite/index\":59,\"./type/const/index\":63,\"./type/constructor-parameters/index\":65,\"./type/constructor/index\":67,\"./type/create/index\":69,\"./type/date/index\":72,\"./type/enum/index\":76,\"./type/error/index\":78,\"./type/exclude/index\":82,\"./type/extends/index\":88,\"./type/extract/index\":92,\"./type/function/index\":94,\"./type/guard/index\":95,\"./type/helpers/index\":100,\"./type/indexed/index\":101,\"./type/instance-type/index\":106,\"./type/instantiate/index\":108,\"./type/integer/index\":110,\"./type/intersect/index\":112,\"./type/intrinsic/index\":118,\"./type/iterator/index\":124,\"./type/keyof/index\":126,\"./type/literal/index\":131,\"./type/mapped/index\":133,\"./type/module/index\":138,\"./type/never/index\":140,\"./type/not/index\":142,\"./type/null/index\":144,\"./type/number/index\":146,\"./type/object/index\":148,\"./type/omit/index\":150,\"./type/optional/index\":154,\"./type/parameters/index\":157,\"./type/partial/index\":159,\"./type/patterns/index\":162,\"./type/pick/index\":164,\"./type/promise/index\":168,\"./type/readonly-optional/index\":170,\"./type/readonly/index\":172,\"./type/record/index\":175,\"./type/recursive/index\":177,\"./type/ref/index\":179,\"./type/regexp/index\":181,\"./type/registry/index\":184,\"./type/required/index\":186,\"./type/rest/index\":189,\"./type/return-type/index\":191,\"./type/schema/index\":194,\"./type/sets/index\":196,\"./type/static/index\":198,\"./type/string/index\":200,\"./type/symbol/index\":202,\"./type/symbols/index\":204,\"./type/template-literal/index\":208,\"./type/transform/index\":214,\"./type/tuple/index\":216,\"./type/type/index\":218,\"./type/uint8array/index\":222,\"./type/undefined/index\":224,\"./type/union/index\":226,\"./type/unknown/index\":231,\"./type/unsafe/index\":233,\"./type/void/index\":235}],38:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./policy\"), exports);\n__exportStar(require(\"./system\"), exports);\n\n},{\"./policy\":39,\"./system\":40}],39:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TypeSystemPolicy = void 0;\nvar index_1 = require(\"../value/guard/index\");\nvar TypeSystemPolicy;\n(function (TypeSystemPolicy) {\n  // ------------------------------------------------------------------\n  // TypeSystemPolicy: Instancing\n  // ------------------------------------------------------------------\n  /**\n   * Configures the instantiation behavior of TypeBox types. The `default` option assigns raw JavaScript\n   * references for embedded types, which may cause side effects if type properties are explicitly updated\n   * outside the TypeBox type builder. The `clone` option creates copies of any shared types upon creation,\n   * preventing unintended side effects. The `freeze` option applies `Object.freeze()` to the type, making\n   * it fully readonly and immutable. Implementations should use `default` whenever possible, as it is the\n   * fastest way to instantiate types. The default setting is `default`.\n   */\n  TypeSystemPolicy.InstanceMode = 'default';\n  // ------------------------------------------------------------------\n  // TypeSystemPolicy: Checking\n  // ------------------------------------------------------------------\n  /** Sets whether TypeBox should assert optional properties using the TypeScript `exactOptionalPropertyTypes` assertion policy. The default is `false` */\n  TypeSystemPolicy.ExactOptionalPropertyTypes = false;\n  /** Sets whether arrays should be treated as a kind of objects. The default is `false` */\n  TypeSystemPolicy.AllowArrayObject = false;\n  /** Sets whether `NaN` or `Infinity` should be treated as valid numeric values. The default is `false` */\n  TypeSystemPolicy.AllowNaN = false;\n  /** Sets whether `null` should validate for void types. The default is `false` */\n  TypeSystemPolicy.AllowNullVoid = false;\n  /** Checks this value using the ExactOptionalPropertyTypes policy */\n  function IsExactOptionalProperty(value, key) {\n    return TypeSystemPolicy.ExactOptionalPropertyTypes ? key in value : value[key] !== undefined;\n  }\n  TypeSystemPolicy.IsExactOptionalProperty = IsExactOptionalProperty;\n  /** Checks this value using the AllowArrayObjects policy */\n  function IsObjectLike(value) {\n    var isObject = (0, index_1.IsObject)(value);\n    return TypeSystemPolicy.AllowArrayObject ? isObject : isObject && !(0, index_1.IsArray)(value);\n  }\n  TypeSystemPolicy.IsObjectLike = IsObjectLike;\n  /** Checks this value as a record using the AllowArrayObjects policy */\n  function IsRecordLike(value) {\n    return IsObjectLike(value) && !(value instanceof Date) && !(value instanceof Uint8Array);\n  }\n  TypeSystemPolicy.IsRecordLike = IsRecordLike;\n  /** Checks this value using the AllowNaN policy */\n  function IsNumberLike(value) {\n    return TypeSystemPolicy.AllowNaN ? (0, index_1.IsNumber)(value) : Number.isFinite(value);\n  }\n  TypeSystemPolicy.IsNumberLike = IsNumberLike;\n  /** Checks this value using the AllowVoidNull policy */\n  function IsVoidLike(value) {\n    var isUndefined = (0, index_1.IsUndefined)(value);\n    return TypeSystemPolicy.AllowNullVoid ? isUndefined || value === null : isUndefined;\n  }\n  TypeSystemPolicy.IsVoidLike = IsVoidLike;\n})(TypeSystemPolicy || (exports.TypeSystemPolicy = TypeSystemPolicy = {}));\n\n},{\"../value/guard/index\":242}],40:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TypeSystem = exports.TypeSystemDuplicateFormat = exports.TypeSystemDuplicateTypeKind = void 0;\nvar index_1 = require(\"../type/registry/index\");\nvar index_2 = require(\"../type/unsafe/index\");\nvar index_3 = require(\"../type/symbols/index\");\nvar index_4 = require(\"../type/error/index\");\n// ------------------------------------------------------------------\n// Errors\n// ------------------------------------------------------------------\nvar TypeSystemDuplicateTypeKind = /*#__PURE__*/function (_index_4$TypeBoxError) {\n  function TypeSystemDuplicateTypeKind(kind) {\n    _classCallCheck(this, TypeSystemDuplicateTypeKind);\n    return _callSuper(this, TypeSystemDuplicateTypeKind, [\"Duplicate type kind '\".concat(kind, \"' detected\")]);\n  }\n  _inherits(TypeSystemDuplicateTypeKind, _index_4$TypeBoxError);\n  return _createClass(TypeSystemDuplicateTypeKind);\n}(index_4.TypeBoxError);\nexports.TypeSystemDuplicateTypeKind = TypeSystemDuplicateTypeKind;\nvar TypeSystemDuplicateFormat = /*#__PURE__*/function (_index_4$TypeBoxError2) {\n  function TypeSystemDuplicateFormat(kind) {\n    _classCallCheck(this, TypeSystemDuplicateFormat);\n    return _callSuper(this, TypeSystemDuplicateFormat, [\"Duplicate string format '\".concat(kind, \"' detected\")]);\n  }\n  _inherits(TypeSystemDuplicateFormat, _index_4$TypeBoxError2);\n  return _createClass(TypeSystemDuplicateFormat);\n}(index_4.TypeBoxError);\nexports.TypeSystemDuplicateFormat = TypeSystemDuplicateFormat;\n/** Creates user defined types and formats and provides overrides for value checking behaviours */\nvar TypeSystem;\n(function (TypeSystem) {\n  /** Creates a new type */\n  function Type(kind, check) {\n    if (index_1.TypeRegistry.Has(kind)) throw new TypeSystemDuplicateTypeKind(kind);\n    index_1.TypeRegistry.Set(kind, check);\n    return function () {\n      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n      return (0, index_2.Unsafe)(_objectSpread(_objectSpread({}, options), {}, _defineProperty({}, index_3.Kind, kind)));\n    };\n  }\n  TypeSystem.Type = Type;\n  /** Creates a new string format */\n  function Format(format, check) {\n    if (index_1.FormatRegistry.Has(format)) throw new TypeSystemDuplicateFormat(format);\n    index_1.FormatRegistry.Set(format, check);\n    return format;\n  }\n  TypeSystem.Format = Format;\n})(TypeSystem || (exports.TypeSystem = TypeSystem = {}));\n\n},{\"../type/error/index\":78,\"../type/registry/index\":184,\"../type/symbols/index\":204,\"../type/unsafe/index\":233}],41:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Any = Any;\nvar index_1 = require(\"../create/index\");\nvar index_2 = require(\"../symbols/index\");\n/** `[Json]` Creates an Any type */\nfunction Any(options) {\n  return (0, index_1.CreateType)(_defineProperty({}, index_2.Kind, 'Any'), options);\n}\n\n},{\"../create/index\":69,\"../symbols/index\":204}],42:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./any\"), exports);\n\n},{\"./any\":41}],43:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Argument = Argument;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[JavaScript]` Creates an Argument Type. */\nfunction Argument(index) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty({}, index_1.Kind, 'Argument'), \"index\", index));\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],44:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./argument\"), exports);\n\n},{\"./argument\":43}],45:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Array = Array;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[Json]` Creates an Array type */\nfunction Array(items, options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty(_defineProperty({}, index_1.Kind, 'Array'), \"type\", 'array'), \"items\", items), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],46:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./array\"), exports);\n\n},{\"./array\":45}],47:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.AsyncIterator = AsyncIterator;\nvar index_1 = require(\"../symbols/index\");\nvar type_1 = require(\"../create/type\");\n/** `[JavaScript]` Creates a AsyncIterator type */\nfunction AsyncIterator(items, options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty(_defineProperty({}, index_1.Kind, 'AsyncIterator'), \"type\", 'AsyncIterator'), \"items\", items), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],48:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./async-iterator\"), exports);\n\n},{\"./async-iterator\":47}],49:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Awaited = Awaited;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../computed/index\");\nvar index_2 = require(\"../intersect/index\");\nvar index_3 = require(\"../union/index\");\nvar index_4 = require(\"../ref/index\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\n// prettier-ignore\nfunction FromComputed(target, parameters) {\n  return (0, index_1.Computed)('Awaited', [(0, index_1.Computed)(target, parameters)]);\n}\n// prettier-ignore\nfunction FromRef($ref) {\n  return (0, index_1.Computed)('Awaited', [(0, index_4.Ref)($ref)]);\n}\n// prettier-ignore\nfunction FromIntersect(types) {\n  return (0, index_2.Intersect)(FromRest(types));\n}\n// prettier-ignore\nfunction FromUnion(types) {\n  return (0, index_3.Union)(FromRest(types));\n}\n// prettier-ignore\nfunction FromPromise(type) {\n  return Awaited(type);\n}\n// prettier-ignore\nfunction FromRest(types) {\n  return types.map(function (type) {\n    return Awaited(type);\n  });\n}\n/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */\nfunction Awaited(type, options) {\n  return (0, type_1.CreateType)((0, kind_1.IsComputed)(type) ? FromComputed(type.target, type.parameters) : (0, kind_1.IsIntersect)(type) ? FromIntersect(type.allOf) : (0, kind_1.IsUnion)(type) ? FromUnion(type.anyOf) : (0, kind_1.IsPromise)(type) ? FromPromise(type.item) : (0, kind_1.IsRef)(type) ? FromRef(type.$ref) : type, options);\n}\n\n},{\"../computed/index\":61,\"../create/type\":70,\"../guard/kind\":96,\"../intersect/index\":112,\"../ref/index\":179,\"../union/index\":226}],50:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./awaited\"), exports);\n\n},{\"./awaited\":49}],51:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.BigInt = BigInt;\nvar index_1 = require(\"../symbols/index\");\nvar index_2 = require(\"../create/index\");\n/** `[JavaScript]` Creates a BigInt type */\nfunction BigInt(options) {\n  return (0, index_2.CreateType)(_defineProperty(_defineProperty({}, index_1.Kind, 'BigInt'), \"type\", 'bigint'), options);\n}\n\n},{\"../create/index\":69,\"../symbols/index\":204}],52:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./bigint\"), exports);\n\n},{\"./bigint\":51}],53:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Boolean = Boolean;\nvar index_1 = require(\"../symbols/index\");\nvar index_2 = require(\"../create/index\");\n/** `[Json]` Creates a Boolean type */\nfunction Boolean(options) {\n  return (0, index_2.CreateType)(_defineProperty(_defineProperty({}, index_1.Kind, 'Boolean'), \"type\", 'boolean'), options);\n}\n\n},{\"../create/index\":69,\"../symbols/index\":204}],54:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./boolean\"), exports);\n\n},{\"./boolean\":53}],55:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./type\"), exports);\n__exportStar(require(\"./value\"), exports);\n\n},{\"./type\":56,\"./value\":57}],56:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.CloneRest = CloneRest;\nexports.CloneType = CloneType;\nvar value_1 = require(\"./value\");\n/** Clones a Rest */\nfunction CloneRest(schemas) {\n  return schemas.map(function (schema) {\n    return CloneType(schema);\n  });\n}\n/** Clones a Type */\nfunction CloneType(schema, options) {\n  return options === undefined ? (0, value_1.Clone)(schema) : (0, value_1.Clone)(_objectSpread(_objectSpread({}, options), schema));\n}\n\n},{\"./value\":57}],57:[function(require,module,exports){\n\"use strict\";\n\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Clone = Clone;\nvar ValueGuard = require(\"../guard/value\");\nfunction ArrayType(value) {\n  return value.map(function (value) {\n    return Visit(value);\n  });\n}\nfunction DateType(value) {\n  return new Date(value.getTime());\n}\nfunction Uint8ArrayType(value) {\n  return new Uint8Array(value);\n}\nfunction RegExpType(value) {\n  return new RegExp(value.source, value.flags);\n}\nfunction ObjectType(value) {\n  var result = {};\n  var _iterator = _createForOfIteratorHelper(Object.getOwnPropertyNames(value)),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var key = _step.value;\n      result[key] = Visit(value[key]);\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  var _iterator2 = _createForOfIteratorHelper(Object.getOwnPropertySymbols(value)),\n    _step2;\n  try {\n    for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n      var _key = _step2.value;\n      result[_key] = Visit(value[_key]);\n    }\n  } catch (err) {\n    _iterator2.e(err);\n  } finally {\n    _iterator2.f();\n  }\n  return result;\n}\n// prettier-ignore\nfunction Visit(value) {\n  return ValueGuard.IsArray(value) ? ArrayType(value) : ValueGuard.IsDate(value) ? DateType(value) : ValueGuard.IsUint8Array(value) ? Uint8ArrayType(value) : ValueGuard.IsRegExp(value) ? RegExpType(value) : ValueGuard.IsObject(value) ? ObjectType(value) : value;\n}\n/** Clones a value */\nfunction Clone(value) {\n  return Visit(value);\n}\n\n},{\"../guard/value\":98}],58:[function(require,module,exports){\n\"use strict\";\n\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Composite = Composite;\nvar index_1 = require(\"../intersect/index\");\nvar index_2 = require(\"../indexed/index\");\nvar index_3 = require(\"../keyof/index\");\nvar index_4 = require(\"../object/index\");\nvar index_5 = require(\"../sets/index\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\n// prettier-ignore\nfunction CompositeKeys(T) {\n  var Acc = [];\n  var _iterator = _createForOfIteratorHelper(T),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var L = _step.value;\n      Acc.push.apply(Acc, _toConsumableArray((0, index_3.KeyOfPropertyKeys)(L)));\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return (0, index_5.SetDistinct)(Acc);\n}\n// prettier-ignore\nfunction FilterNever(T) {\n  return T.filter(function (L) {\n    return !(0, kind_1.IsNever)(L);\n  });\n}\n// prettier-ignore\nfunction CompositeProperty(T, K) {\n  var Acc = [];\n  var _iterator2 = _createForOfIteratorHelper(T),\n    _step2;\n  try {\n    for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n      var L = _step2.value;\n      Acc.push.apply(Acc, _toConsumableArray((0, index_2.IndexFromPropertyKeys)(L, [K])));\n    }\n  } catch (err) {\n    _iterator2.e(err);\n  } finally {\n    _iterator2.f();\n  }\n  return FilterNever(Acc);\n}\n// prettier-ignore\nfunction CompositeProperties(T, K) {\n  var Acc = {};\n  var _iterator3 = _createForOfIteratorHelper(K),\n    _step3;\n  try {\n    for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n      var L = _step3.value;\n      Acc[L] = (0, index_1.IntersectEvaluated)(CompositeProperty(T, L));\n    }\n  } catch (err) {\n    _iterator3.e(err);\n  } finally {\n    _iterator3.f();\n  }\n  return Acc;\n}\n// prettier-ignore\nfunction Composite(T, options) {\n  var K = CompositeKeys(T);\n  var P = CompositeProperties(T, K);\n  var R = (0, index_4.Object)(P, options);\n  return R;\n}\n\n},{\"../guard/kind\":96,\"../indexed/index\":101,\"../intersect/index\":112,\"../keyof/index\":126,\"../object/index\":148,\"../sets/index\":196}],59:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./composite\"), exports);\n\n},{\"./composite\":58}],60:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Computed = Computed;\nvar index_1 = require(\"../create/index\");\nvar symbols_1 = require(\"../symbols/symbols\");\n/** `[Internal]` Creates a deferred computed type. This type is used exclusively in modules to defer resolution of computable types that contain interior references  */\nfunction Computed(target, parameters, options) {\n  return (0, index_1.CreateType)(_defineProperty(_defineProperty(_defineProperty({}, symbols_1.Kind, 'Computed'), \"target\", target), \"parameters\", parameters), options);\n}\n\n},{\"../create/index\":69,\"../symbols/symbols\":205}],61:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./computed\"), exports);\n\n},{\"./computed\":60}],62:[function(require,module,exports){\n\"use strict\";\n\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Const = Const;\nvar index_1 = require(\"../any/index\");\nvar index_2 = require(\"../bigint/index\");\nvar index_3 = require(\"../date/index\");\nvar index_4 = require(\"../function/index\");\nvar index_5 = require(\"../literal/index\");\nvar index_6 = require(\"../null/index\");\nvar index_7 = require(\"../object/index\");\nvar index_8 = require(\"../symbol/index\");\nvar index_9 = require(\"../tuple/index\");\nvar index_10 = require(\"../readonly/index\");\nvar index_11 = require(\"../undefined/index\");\nvar index_12 = require(\"../uint8array/index\");\nvar index_13 = require(\"../unknown/index\");\nvar index_14 = require(\"../create/index\");\n// ------------------------------------------------------------------\n// ValueGuard\n// ------------------------------------------------------------------\nvar value_1 = require(\"../guard/value\");\n// prettier-ignore\nfunction FromArray(T) {\n  return T.map(function (L) {\n    return FromValue(L, false);\n  });\n}\n// prettier-ignore\nfunction FromProperties(value) {\n  var Acc = {};\n  var _iterator = _createForOfIteratorHelper(globalThis.Object.getOwnPropertyNames(value)),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var K = _step.value;\n      Acc[K] = (0, index_10.Readonly)(FromValue(value[K], false));\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return Acc;\n}\nfunction ConditionalReadonly(T, root) {\n  return root === true ? T : (0, index_10.Readonly)(T);\n}\n// prettier-ignore\nfunction FromValue(value, root) {\n  return (0, value_1.IsAsyncIterator)(value) ? ConditionalReadonly((0, index_1.Any)(), root) : (0, value_1.IsIterator)(value) ? ConditionalReadonly((0, index_1.Any)(), root) : (0, value_1.IsArray)(value) ? (0, index_10.Readonly)((0, index_9.Tuple)(FromArray(value))) : (0, value_1.IsUint8Array)(value) ? (0, index_12.Uint8Array)() : (0, value_1.IsDate)(value) ? (0, index_3.Date)() : (0, value_1.IsObject)(value) ? ConditionalReadonly((0, index_7.Object)(FromProperties(value)), root) : (0, value_1.IsFunction)(value) ? ConditionalReadonly((0, index_4.Function)([], (0, index_13.Unknown)()), root) : (0, value_1.IsUndefined)(value) ? (0, index_11.Undefined)() : (0, value_1.IsNull)(value) ? (0, index_6.Null)() : (0, value_1.IsSymbol)(value) ? (0, index_8.Symbol)() : (0, value_1.IsBigInt)(value) ? (0, index_2.BigInt)() : (0, value_1.IsNumber)(value) ? (0, index_5.Literal)(value) : (0, value_1.IsBoolean)(value) ? (0, index_5.Literal)(value) : (0, value_1.IsString)(value) ? (0, index_5.Literal)(value) : (0, index_7.Object)({});\n}\n/** `[JavaScript]` Creates a readonly const type from the given value. */\nfunction Const(T, options) {\n  return (0, index_14.CreateType)(FromValue(T, true), options);\n}\n\n},{\"../any/index\":42,\"../bigint/index\":52,\"../create/index\":69,\"../date/index\":72,\"../function/index\":94,\"../guard/value\":98,\"../literal/index\":131,\"../null/index\":144,\"../object/index\":148,\"../readonly/index\":172,\"../symbol/index\":202,\"../tuple/index\":216,\"../uint8array/index\":222,\"../undefined/index\":224,\"../unknown/index\":231}],63:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./const\"), exports);\n\n},{\"./const\":62}],64:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ConstructorParameters = ConstructorParameters;\nvar index_1 = require(\"../tuple/index\");\nvar index_2 = require(\"../never/index\");\nvar KindGuard = require(\"../guard/kind\");\n/** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */\nfunction ConstructorParameters(schema, options) {\n  return KindGuard.IsConstructor(schema) ? (0, index_1.Tuple)(schema.parameters, options) : (0, index_2.Never)(options);\n}\n\n},{\"../guard/kind\":96,\"../never/index\":140,\"../tuple/index\":216}],65:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./constructor-parameters\"), exports);\n\n},{\"./constructor-parameters\":64}],66:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Constructor = Constructor;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[JavaScript]` Creates a Constructor type */\nfunction Constructor(parameters, returns, options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, index_1.Kind, 'Constructor'), \"type\", 'Constructor'), \"parameters\", parameters), \"returns\", returns), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],67:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./constructor\"), exports);\n\n},{\"./constructor\":66}],68:[function(require,module,exports){\n\"use strict\";\n\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Immutable = Immutable;\nvar ValueGuard = require(\"../guard/value\");\nfunction ImmutableArray(value) {\n  return globalThis.Object.freeze(value).map(function (value) {\n    return Immutable(value);\n  });\n}\nfunction ImmutableDate(value) {\n  return value;\n}\nfunction ImmutableUint8Array(value) {\n  return value;\n}\nfunction ImmutableRegExp(value) {\n  return value;\n}\nfunction ImmutableObject(value) {\n  var result = {};\n  var _iterator = _createForOfIteratorHelper(Object.getOwnPropertyNames(value)),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var key = _step.value;\n      result[key] = Immutable(value[key]);\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  var _iterator2 = _createForOfIteratorHelper(Object.getOwnPropertySymbols(value)),\n    _step2;\n  try {\n    for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n      var _key = _step2.value;\n      result[_key] = Immutable(value[_key]);\n    }\n  } catch (err) {\n    _iterator2.e(err);\n  } finally {\n    _iterator2.f();\n  }\n  return globalThis.Object.freeze(result);\n}\n/** Specialized deep immutable value. Applies freeze recursively to the given value */\n// prettier-ignore\nfunction Immutable(value) {\n  return ValueGuard.IsArray(value) ? ImmutableArray(value) : ValueGuard.IsDate(value) ? ImmutableDate(value) : ValueGuard.IsUint8Array(value) ? ImmutableUint8Array(value) : ValueGuard.IsRegExp(value) ? ImmutableRegExp(value) : ValueGuard.IsObject(value) ? ImmutableObject(value) : value;\n}\n\n},{\"../guard/value\":98}],69:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./type\"), exports);\n\n},{\"./type\":70}],70:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.CreateType = CreateType;\nvar policy_1 = require(\"../../system/policy\");\nvar immutable_1 = require(\"./immutable\");\nvar value_1 = require(\"../clone/value\");\n/** Creates TypeBox schematics using the configured InstanceMode */\nfunction CreateType(schema, options) {\n  var result = options !== undefined ? _objectSpread(_objectSpread({}, options), schema) : schema;\n  switch (policy_1.TypeSystemPolicy.InstanceMode) {\n    case 'freeze':\n      return (0, immutable_1.Immutable)(result);\n    case 'clone':\n      return (0, value_1.Clone)(result);\n    default:\n      return result;\n  }\n}\n\n},{\"../../system/policy\":39,\"../clone/value\":57,\"./immutable\":68}],71:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Date = Date;\nvar index_1 = require(\"../symbols/index\");\nvar type_1 = require(\"../create/type\");\n/** `[JavaScript]` Creates a Date type */\nfunction Date(options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty({}, index_1.Kind, 'Date'), \"type\", 'Date'), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],72:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./date\"), exports);\n\n},{\"./date\":71}],73:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }\nfunction _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Discard = Discard;\nfunction DiscardKey(value, key) {\n  var _ = value[key],\n    rest = _objectWithoutProperties(value, [key].map(_toPropertyKey));\n  return rest;\n}\n/** Discards property keys from the given value. This function returns a shallow Clone. */\nfunction Discard(value, keys) {\n  return keys.reduce(function (acc, key) {\n    return DiscardKey(acc, key);\n  }, value);\n}\n\n},{}],74:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./discard\"), exports);\n\n},{\"./discard\":73}],75:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Enum = Enum;\nvar index_1 = require(\"../literal/index\");\nvar index_2 = require(\"../symbols/index\");\nvar index_3 = require(\"../union/index\");\n// ------------------------------------------------------------------\n// ValueGuard\n// ------------------------------------------------------------------\nvar value_1 = require(\"../guard/value\");\n/** `[Json]` Creates a Enum type */\nfunction Enum(item, options) {\n  if ((0, value_1.IsUndefined)(item)) throw new Error('Enum undefined or empty');\n  var values1 = globalThis.Object.getOwnPropertyNames(item).filter(function (key) {\n    return isNaN(key);\n  }).map(function (key) {\n    return item[key];\n  });\n  var values2 = _toConsumableArray(new Set(values1));\n  var anyOf = values2.map(function (value) {\n    return (0, index_1.Literal)(value);\n  });\n  return (0, index_3.Union)(anyOf, _objectSpread(_objectSpread({}, options), {}, _defineProperty({}, index_2.Hint, 'Enum')));\n}\n\n},{\"../guard/value\":98,\"../literal/index\":131,\"../symbols/index\":204,\"../union/index\":226}],76:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./enum\"), exports);\n\n},{\"./enum\":75}],77:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _wrapNativeSuper(t) { var r = \"function\" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !_isNativeFunction(t)) return t; if (\"function\" != typeof t) throw new TypeError(\"Super expression must either be null or a function\"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), _setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); }\nfunction _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf(\"[native code]\"); } catch (n) { return \"function\" == typeof t; } }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TypeBoxError = void 0;\n/** The base Error type thrown for all TypeBox exceptions  */\nvar TypeBoxError = /*#__PURE__*/function (_Error) {\n  function TypeBoxError(message) {\n    _classCallCheck(this, TypeBoxError);\n    return _callSuper(this, TypeBoxError, [message]);\n  }\n  _inherits(TypeBoxError, _Error);\n  return _createClass(TypeBoxError);\n}(/*#__PURE__*/_wrapNativeSuper(Error));\nexports.TypeBoxError = TypeBoxError;\n\n},{}],78:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./error\"), exports);\n\n},{\"./error\":77}],79:[function(require,module,exports){\n\"use strict\";\n\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ExcludeFromMappedResult = ExcludeFromMappedResult;\nvar index_1 = require(\"../mapped/index\");\nvar exclude_1 = require(\"./exclude\");\n// prettier-ignore\nfunction FromProperties(P, U) {\n  var Acc = {};\n  var _iterator = _createForOfIteratorHelper(globalThis.Object.getOwnPropertyNames(P)),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var K2 = _step.value;\n      Acc[K2] = (0, exclude_1.Exclude)(P[K2], U);\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return Acc;\n}\n// prettier-ignore\nfunction FromMappedResult(R, T) {\n  return FromProperties(R.properties, T);\n}\n// prettier-ignore\nfunction ExcludeFromMappedResult(R, T) {\n  var P = FromMappedResult(R, T);\n  return (0, index_1.MappedResult)(P);\n}\n\n},{\"../mapped/index\":133,\"./exclude\":81}],80:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ExcludeFromTemplateLiteral = ExcludeFromTemplateLiteral;\nvar exclude_1 = require(\"./exclude\");\nvar index_1 = require(\"../template-literal/index\");\nfunction ExcludeFromTemplateLiteral(L, R) {\n  return (0, exclude_1.Exclude)((0, index_1.TemplateLiteralToUnion)(L), R);\n}\n\n},{\"../template-literal/index\":208,\"./exclude\":81}],81:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Exclude = Exclude;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../union/index\");\nvar index_2 = require(\"../never/index\");\nvar index_3 = require(\"../extends/index\");\nvar exclude_from_mapped_result_1 = require(\"./exclude-from-mapped-result\");\nvar exclude_from_template_literal_1 = require(\"./exclude-from-template-literal\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\nfunction ExcludeRest(L, R) {\n  var excluded = L.filter(function (inner) {\n    return (0, index_3.ExtendsCheck)(inner, R) === index_3.ExtendsResult.False;\n  });\n  return excluded.length === 1 ? excluded[0] : (0, index_1.Union)(excluded);\n}\n/** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */\nfunction Exclude(L, R) {\n  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n  // overloads\n  if ((0, kind_1.IsTemplateLiteral)(L)) return (0, type_1.CreateType)((0, exclude_from_template_literal_1.ExcludeFromTemplateLiteral)(L, R), options);\n  if ((0, kind_1.IsMappedResult)(L)) return (0, type_1.CreateType)((0, exclude_from_mapped_result_1.ExcludeFromMappedResult)(L, R), options);\n  // prettier-ignore\n  return (0, type_1.CreateType)((0, kind_1.IsUnion)(L) ? ExcludeRest(L.anyOf, R) : (0, index_3.ExtendsCheck)(L, R) !== index_3.ExtendsResult.False ? (0, index_2.Never)() : L, options);\n}\n\n},{\"../create/type\":70,\"../extends/index\":88,\"../guard/kind\":96,\"../never/index\":140,\"../union/index\":226,\"./exclude-from-mapped-result\":79,\"./exclude-from-template-literal\":80}],82:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./exclude-from-mapped-result\"), exports);\n__exportStar(require(\"./exclude-from-template-literal\"), exports);\n__exportStar(require(\"./exclude\"), exports);\n\n},{\"./exclude\":81,\"./exclude-from-mapped-result\":79,\"./exclude-from-template-literal\":80}],83:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ExtendsResult = exports.ExtendsResolverError = void 0;\nexports.ExtendsCheck = ExtendsCheck;\nvar index_1 = require(\"../any/index\");\nvar index_2 = require(\"../function/index\");\nvar index_3 = require(\"../number/index\");\nvar index_4 = require(\"../string/index\");\nvar index_5 = require(\"../unknown/index\");\nvar index_6 = require(\"../template-literal/index\");\nvar index_7 = require(\"../patterns/index\");\nvar index_8 = require(\"../symbols/index\");\nvar index_9 = require(\"../error/index\");\nvar index_10 = require(\"../guard/index\");\nvar ExtendsResolverError = /*#__PURE__*/function (_index_9$TypeBoxError) {\n  function ExtendsResolverError() {\n    _classCallCheck(this, ExtendsResolverError);\n    return _callSuper(this, ExtendsResolverError, arguments);\n  }\n  _inherits(ExtendsResolverError, _index_9$TypeBoxError);\n  return _createClass(ExtendsResolverError);\n}(index_9.TypeBoxError);\nexports.ExtendsResolverError = ExtendsResolverError;\nvar ExtendsResult;\n(function (ExtendsResult) {\n  ExtendsResult[ExtendsResult[\"Union\"] = 0] = \"Union\";\n  ExtendsResult[ExtendsResult[\"True\"] = 1] = \"True\";\n  ExtendsResult[ExtendsResult[\"False\"] = 2] = \"False\";\n})(ExtendsResult || (exports.ExtendsResult = ExtendsResult = {}));\n// ------------------------------------------------------------------\n// IntoBooleanResult\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction IntoBooleanResult(result) {\n  return result === ExtendsResult.False ? result : ExtendsResult.True;\n}\n// ------------------------------------------------------------------\n// Throw\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction Throw(message) {\n  throw new ExtendsResolverError(message);\n}\n// ------------------------------------------------------------------\n// StructuralRight\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction IsStructuralRight(right) {\n  return index_10.TypeGuard.IsNever(right) || index_10.TypeGuard.IsIntersect(right) || index_10.TypeGuard.IsUnion(right) || index_10.TypeGuard.IsUnknown(right) || index_10.TypeGuard.IsAny(right);\n}\n// prettier-ignore\nfunction StructuralRight(left, right) {\n  return index_10.TypeGuard.IsNever(right) ? FromNeverRight(left, right) : index_10.TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) : index_10.TypeGuard.IsUnion(right) ? FromUnionRight(left, right) : index_10.TypeGuard.IsUnknown(right) ? FromUnknownRight(left, right) : index_10.TypeGuard.IsAny(right) ? FromAnyRight(left, right) : Throw('StructuralRight');\n}\n// ------------------------------------------------------------------\n// Any\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromAnyRight(left, right) {\n  return ExtendsResult.True;\n}\n// prettier-ignore\nfunction FromAny(left, right) {\n  return index_10.TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) : index_10.TypeGuard.IsUnion(right) && right.anyOf.some(function (schema) {\n    return index_10.TypeGuard.IsAny(schema) || index_10.TypeGuard.IsUnknown(schema);\n  }) ? ExtendsResult.True : index_10.TypeGuard.IsUnion(right) ? ExtendsResult.Union : index_10.TypeGuard.IsUnknown(right) ? ExtendsResult.True : index_10.TypeGuard.IsAny(right) ? ExtendsResult.True : ExtendsResult.Union;\n}\n// ------------------------------------------------------------------\n// Array\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromArrayRight(left, right) {\n  return index_10.TypeGuard.IsUnknown(left) ? ExtendsResult.False : index_10.TypeGuard.IsAny(left) ? ExtendsResult.Union : index_10.TypeGuard.IsNever(left) ? ExtendsResult.True : ExtendsResult.False;\n}\n// prettier-ignore\nfunction FromArray(left, right) {\n  return index_10.TypeGuard.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : !index_10.TypeGuard.IsArray(right) ? ExtendsResult.False : IntoBooleanResult(Visit(left.items, right.items));\n}\n// ------------------------------------------------------------------\n// AsyncIterator\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromAsyncIterator(left, right) {\n  return IsStructuralRight(right) ? StructuralRight(left, right) : !index_10.TypeGuard.IsAsyncIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit(left.items, right.items));\n}\n// ------------------------------------------------------------------\n// BigInt\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromBigInt(left, right) {\n  return IsStructuralRight(right) ? StructuralRight(left, right) : index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : index_10.TypeGuard.IsBigInt(right) ? ExtendsResult.True : ExtendsResult.False;\n}\n// ------------------------------------------------------------------\n// Boolean\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromBooleanRight(left, right) {\n  return index_10.TypeGuard.IsLiteralBoolean(left) ? ExtendsResult.True : index_10.TypeGuard.IsBoolean(left) ? ExtendsResult.True : ExtendsResult.False;\n}\n// prettier-ignore\nfunction FromBoolean(left, right) {\n  return IsStructuralRight(right) ? StructuralRight(left, right) : index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : index_10.TypeGuard.IsBoolean(right) ? ExtendsResult.True : ExtendsResult.False;\n}\n// ------------------------------------------------------------------\n// Constructor\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromConstructor(left, right) {\n  return IsStructuralRight(right) ? StructuralRight(left, right) : index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : !index_10.TypeGuard.IsConstructor(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every(function (schema, index) {\n    return IntoBooleanResult(Visit(right.parameters[index], schema)) === ExtendsResult.True;\n  }) ? ExtendsResult.False : IntoBooleanResult(Visit(left.returns, right.returns));\n}\n// ------------------------------------------------------------------\n// Date\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromDate(left, right) {\n  return IsStructuralRight(right) ? StructuralRight(left, right) : index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : index_10.TypeGuard.IsDate(right) ? ExtendsResult.True : ExtendsResult.False;\n}\n// ------------------------------------------------------------------\n// Function\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromFunction(left, right) {\n  return IsStructuralRight(right) ? StructuralRight(left, right) : index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : !index_10.TypeGuard.IsFunction(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every(function (schema, index) {\n    return IntoBooleanResult(Visit(right.parameters[index], schema)) === ExtendsResult.True;\n  }) ? ExtendsResult.False : IntoBooleanResult(Visit(left.returns, right.returns));\n}\n// ------------------------------------------------------------------\n// Integer\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromIntegerRight(left, right) {\n  return index_10.TypeGuard.IsLiteral(left) && index_10.ValueGuard.IsNumber(left[\"const\"]) ? ExtendsResult.True : index_10.TypeGuard.IsNumber(left) || index_10.TypeGuard.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;\n}\n// prettier-ignore\nfunction FromInteger(left, right) {\n  return index_10.TypeGuard.IsInteger(right) || index_10.TypeGuard.IsNumber(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : ExtendsResult.False;\n}\n// ------------------------------------------------------------------\n// Intersect\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromIntersectRight(left, right) {\n  return right.allOf.every(function (schema) {\n    return Visit(left, schema) === ExtendsResult.True;\n  }) ? ExtendsResult.True : ExtendsResult.False;\n}\n// prettier-ignore\nfunction FromIntersect(left, right) {\n  return left.allOf.some(function (schema) {\n    return Visit(schema, right) === ExtendsResult.True;\n  }) ? ExtendsResult.True : ExtendsResult.False;\n}\n// ------------------------------------------------------------------\n// Iterator\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromIterator(left, right) {\n  return IsStructuralRight(right) ? StructuralRight(left, right) : !index_10.TypeGuard.IsIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit(left.items, right.items));\n}\n// ------------------------------------------------------------------\n// Literal\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromLiteral(left, right) {\n  return index_10.TypeGuard.IsLiteral(right) && right[\"const\"] === left[\"const\"] ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : index_10.TypeGuard.IsString(right) ? FromStringRight(left, right) : index_10.TypeGuard.IsNumber(right) ? FromNumberRight(left, right) : index_10.TypeGuard.IsInteger(right) ? FromIntegerRight(left, right) : index_10.TypeGuard.IsBoolean(right) ? FromBooleanRight(left, right) : ExtendsResult.False;\n}\n// ------------------------------------------------------------------\n// Never\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromNeverRight(left, right) {\n  return ExtendsResult.False;\n}\n// prettier-ignore\nfunction FromNever(left, right) {\n  return ExtendsResult.True;\n}\n// ------------------------------------------------------------------\n// Not\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction UnwrapTNot(schema) {\n  var current = schema,\n    depth = 0;\n  while (true) {\n    if (!index_10.TypeGuard.IsNot(current)) break;\n    current = current.not;\n    depth += 1;\n  }\n  return depth % 2 === 0 ? current : (0, index_5.Unknown)();\n}\n// prettier-ignore\nfunction FromNot(left, right) {\n  // TypeScript has no concept of negated types, and attempts to correctly check the negated\n  // type at runtime would put TypeBox at odds with TypeScripts ability to statically infer\n  // the type. Instead we unwrap to either unknown or T and continue evaluating.\n  // prettier-ignore\n  return index_10.TypeGuard.IsNot(left) ? Visit(UnwrapTNot(left), right) : index_10.TypeGuard.IsNot(right) ? Visit(left, UnwrapTNot(right)) : Throw('Invalid fallthrough for Not');\n}\n// ------------------------------------------------------------------\n// Null\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromNull(left, right) {\n  return IsStructuralRight(right) ? StructuralRight(left, right) : index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : index_10.TypeGuard.IsNull(right) ? ExtendsResult.True : ExtendsResult.False;\n}\n// ------------------------------------------------------------------\n// Number\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromNumberRight(left, right) {\n  return index_10.TypeGuard.IsLiteralNumber(left) ? ExtendsResult.True : index_10.TypeGuard.IsNumber(left) || index_10.TypeGuard.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;\n}\n// prettier-ignore\nfunction FromNumber(left, right) {\n  return IsStructuralRight(right) ? StructuralRight(left, right) : index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : index_10.TypeGuard.IsInteger(right) || index_10.TypeGuard.IsNumber(right) ? ExtendsResult.True : ExtendsResult.False;\n}\n// ------------------------------------------------------------------\n// Object\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction IsObjectPropertyCount(schema, count) {\n  return Object.getOwnPropertyNames(schema.properties).length === count;\n}\n// prettier-ignore\nfunction IsObjectStringLike(schema) {\n  return IsObjectArrayLike(schema);\n}\n// prettier-ignore\nfunction IsObjectSymbolLike(schema) {\n  return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && 'description' in schema.properties && index_10.TypeGuard.IsUnion(schema.properties.description) && schema.properties.description.anyOf.length === 2 && (index_10.TypeGuard.IsString(schema.properties.description.anyOf[0]) && index_10.TypeGuard.IsUndefined(schema.properties.description.anyOf[1]) || index_10.TypeGuard.IsString(schema.properties.description.anyOf[1]) && index_10.TypeGuard.IsUndefined(schema.properties.description.anyOf[0]));\n}\n// prettier-ignore\nfunction IsObjectNumberLike(schema) {\n  return IsObjectPropertyCount(schema, 0);\n}\n// prettier-ignore\nfunction IsObjectBooleanLike(schema) {\n  return IsObjectPropertyCount(schema, 0);\n}\n// prettier-ignore\nfunction IsObjectBigIntLike(schema) {\n  return IsObjectPropertyCount(schema, 0);\n}\n// prettier-ignore\nfunction IsObjectDateLike(schema) {\n  return IsObjectPropertyCount(schema, 0);\n}\n// prettier-ignore\nfunction IsObjectUint8ArrayLike(schema) {\n  return IsObjectArrayLike(schema);\n}\n// prettier-ignore\nfunction IsObjectFunctionLike(schema) {\n  var length = (0, index_3.Number)();\n  return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && 'length' in schema.properties && IntoBooleanResult(Visit(schema.properties['length'], length)) === ExtendsResult.True;\n}\n// prettier-ignore\nfunction IsObjectConstructorLike(schema) {\n  return IsObjectPropertyCount(schema, 0);\n}\n// prettier-ignore\nfunction IsObjectArrayLike(schema) {\n  var length = (0, index_3.Number)();\n  return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && 'length' in schema.properties && IntoBooleanResult(Visit(schema.properties['length'], length)) === ExtendsResult.True;\n}\n// prettier-ignore\nfunction IsObjectPromiseLike(schema) {\n  var then = (0, index_2.Function)([(0, index_1.Any)()], (0, index_1.Any)());\n  return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && 'then' in schema.properties && IntoBooleanResult(Visit(schema.properties['then'], then)) === ExtendsResult.True;\n}\n// ------------------------------------------------------------------\n// Property\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction Property(left, right) {\n  return Visit(left, right) === ExtendsResult.False ? ExtendsResult.False : index_10.TypeGuard.IsOptional(left) && !index_10.TypeGuard.IsOptional(right) ? ExtendsResult.False : ExtendsResult.True;\n}\n// prettier-ignore\nfunction FromObjectRight(left, right) {\n  return index_10.TypeGuard.IsUnknown(left) ? ExtendsResult.False : index_10.TypeGuard.IsAny(left) ? ExtendsResult.Union : index_10.TypeGuard.IsNever(left) || index_10.TypeGuard.IsLiteralString(left) && IsObjectStringLike(right) || index_10.TypeGuard.IsLiteralNumber(left) && IsObjectNumberLike(right) || index_10.TypeGuard.IsLiteralBoolean(left) && IsObjectBooleanLike(right) || index_10.TypeGuard.IsSymbol(left) && IsObjectSymbolLike(right) || index_10.TypeGuard.IsBigInt(left) && IsObjectBigIntLike(right) || index_10.TypeGuard.IsString(left) && IsObjectStringLike(right) || index_10.TypeGuard.IsSymbol(left) && IsObjectSymbolLike(right) || index_10.TypeGuard.IsNumber(left) && IsObjectNumberLike(right) || index_10.TypeGuard.IsInteger(left) && IsObjectNumberLike(right) || index_10.TypeGuard.IsBoolean(left) && IsObjectBooleanLike(right) || index_10.TypeGuard.IsUint8Array(left) && IsObjectUint8ArrayLike(right) || index_10.TypeGuard.IsDate(left) && IsObjectDateLike(right) || index_10.TypeGuard.IsConstructor(left) && IsObjectConstructorLike(right) || index_10.TypeGuard.IsFunction(left) && IsObjectFunctionLike(right) ? ExtendsResult.True : index_10.TypeGuard.IsRecord(left) && index_10.TypeGuard.IsString(RecordKey(left)) ? function () {\n    // When expressing a Record with literal key values, the Record is converted into a Object with\n    // the Hint assigned as `Record`. This is used to invert the extends logic.\n    return right[index_8.Hint] === 'Record' ? ExtendsResult.True : ExtendsResult.False;\n  }() : index_10.TypeGuard.IsRecord(left) && index_10.TypeGuard.IsNumber(RecordKey(left)) ? function () {\n    return IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False;\n  }() : ExtendsResult.False;\n}\n// prettier-ignore\nfunction FromObject(left, right) {\n  return IsStructuralRight(right) ? StructuralRight(left, right) : index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : !index_10.TypeGuard.IsObject(right) ? ExtendsResult.False : function () {\n    var _iterator = _createForOfIteratorHelper(Object.getOwnPropertyNames(right.properties)),\n      _step;\n    try {\n      for (_iterator.s(); !(_step = _iterator.n()).done;) {\n        var key = _step.value;\n        if (!(key in left.properties) && !index_10.TypeGuard.IsOptional(right.properties[key])) {\n          return ExtendsResult.False;\n        }\n        if (index_10.TypeGuard.IsOptional(right.properties[key])) {\n          return ExtendsResult.True;\n        }\n        if (Property(left.properties[key], right.properties[key]) === ExtendsResult.False) {\n          return ExtendsResult.False;\n        }\n      }\n    } catch (err) {\n      _iterator.e(err);\n    } finally {\n      _iterator.f();\n    }\n    return ExtendsResult.True;\n  }();\n}\n// ------------------------------------------------------------------\n// Promise\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromPromise(left, right) {\n  return IsStructuralRight(right) ? StructuralRight(left, right) : index_10.TypeGuard.IsObject(right) && IsObjectPromiseLike(right) ? ExtendsResult.True : !index_10.TypeGuard.IsPromise(right) ? ExtendsResult.False : IntoBooleanResult(Visit(left.item, right.item));\n}\n// ------------------------------------------------------------------\n// Record\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction RecordKey(schema) {\n  return index_7.PatternNumberExact in schema.patternProperties ? (0, index_3.Number)() : index_7.PatternStringExact in schema.patternProperties ? (0, index_4.String)() : Throw('Unknown record key pattern');\n}\n// prettier-ignore\nfunction RecordValue(schema) {\n  return index_7.PatternNumberExact in schema.patternProperties ? schema.patternProperties[index_7.PatternNumberExact] : index_7.PatternStringExact in schema.patternProperties ? schema.patternProperties[index_7.PatternStringExact] : Throw('Unable to get record value schema');\n}\n// prettier-ignore\nfunction FromRecordRight(left, right) {\n  var _ref = [RecordKey(right), RecordValue(right)],\n    Key = _ref[0],\n    Value = _ref[1];\n  return index_10.TypeGuard.IsLiteralString(left) && index_10.TypeGuard.IsNumber(Key) && IntoBooleanResult(Visit(left, Value)) === ExtendsResult.True ? ExtendsResult.True : index_10.TypeGuard.IsUint8Array(left) && index_10.TypeGuard.IsNumber(Key) ? Visit(left, Value) : index_10.TypeGuard.IsString(left) && index_10.TypeGuard.IsNumber(Key) ? Visit(left, Value) : index_10.TypeGuard.IsArray(left) && index_10.TypeGuard.IsNumber(Key) ? Visit(left, Value) : index_10.TypeGuard.IsObject(left) ? function () {\n    var _iterator2 = _createForOfIteratorHelper(Object.getOwnPropertyNames(left.properties)),\n      _step2;\n    try {\n      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n        var key = _step2.value;\n        if (Property(Value, left.properties[key]) === ExtendsResult.False) {\n          return ExtendsResult.False;\n        }\n      }\n    } catch (err) {\n      _iterator2.e(err);\n    } finally {\n      _iterator2.f();\n    }\n    return ExtendsResult.True;\n  }() : ExtendsResult.False;\n}\n// prettier-ignore\nfunction FromRecord(left, right) {\n  return IsStructuralRight(right) ? StructuralRight(left, right) : index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : !index_10.TypeGuard.IsRecord(right) ? ExtendsResult.False : Visit(RecordValue(left), RecordValue(right));\n}\n// ------------------------------------------------------------------\n// RegExp\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromRegExp(left, right) {\n  // Note: RegExp types evaluate as strings, not RegExp objects.\n  // Here we remap either into string and continue evaluating.\n  var L = index_10.TypeGuard.IsRegExp(left) ? (0, index_4.String)() : left;\n  var R = index_10.TypeGuard.IsRegExp(right) ? (0, index_4.String)() : right;\n  return Visit(L, R);\n}\n// ------------------------------------------------------------------\n// String\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromStringRight(left, right) {\n  return index_10.TypeGuard.IsLiteral(left) && index_10.ValueGuard.IsString(left[\"const\"]) ? ExtendsResult.True : index_10.TypeGuard.IsString(left) ? ExtendsResult.True : ExtendsResult.False;\n}\n// prettier-ignore\nfunction FromString(left, right) {\n  return IsStructuralRight(right) ? StructuralRight(left, right) : index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : index_10.TypeGuard.IsString(right) ? ExtendsResult.True : ExtendsResult.False;\n}\n// ------------------------------------------------------------------\n// Symbol\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromSymbol(left, right) {\n  return IsStructuralRight(right) ? StructuralRight(left, right) : index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : index_10.TypeGuard.IsSymbol(right) ? ExtendsResult.True : ExtendsResult.False;\n}\n// ------------------------------------------------------------------\n// TemplateLiteral\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromTemplateLiteral(left, right) {\n  // TemplateLiteral types are resolved to either unions for finite expressions or string\n  // for infinite expressions. Here we call to TemplateLiteralResolver to resolve for\n  // either type and continue evaluating.\n  return index_10.TypeGuard.IsTemplateLiteral(left) ? Visit((0, index_6.TemplateLiteralToUnion)(left), right) : index_10.TypeGuard.IsTemplateLiteral(right) ? Visit(left, (0, index_6.TemplateLiteralToUnion)(right)) : Throw('Invalid fallthrough for TemplateLiteral');\n}\n// ------------------------------------------------------------------\n// Tuple\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction IsArrayOfTuple(left, right) {\n  return index_10.TypeGuard.IsArray(right) && left.items !== undefined && left.items.every(function (schema) {\n    return Visit(schema, right.items) === ExtendsResult.True;\n  });\n}\n// prettier-ignore\nfunction FromTupleRight(left, right) {\n  return index_10.TypeGuard.IsNever(left) ? ExtendsResult.True : index_10.TypeGuard.IsUnknown(left) ? ExtendsResult.False : index_10.TypeGuard.IsAny(left) ? ExtendsResult.Union : ExtendsResult.False;\n}\n// prettier-ignore\nfunction FromTuple(left, right) {\n  return IsStructuralRight(right) ? StructuralRight(left, right) : index_10.TypeGuard.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : index_10.TypeGuard.IsArray(right) && IsArrayOfTuple(left, right) ? ExtendsResult.True : !index_10.TypeGuard.IsTuple(right) ? ExtendsResult.False : index_10.ValueGuard.IsUndefined(left.items) && !index_10.ValueGuard.IsUndefined(right.items) || !index_10.ValueGuard.IsUndefined(left.items) && index_10.ValueGuard.IsUndefined(right.items) ? ExtendsResult.False : index_10.ValueGuard.IsUndefined(left.items) && !index_10.ValueGuard.IsUndefined(right.items) ? ExtendsResult.True : left.items.every(function (schema, index) {\n    return Visit(schema, right.items[index]) === ExtendsResult.True;\n  }) ? ExtendsResult.True : ExtendsResult.False;\n}\n// ------------------------------------------------------------------\n// Uint8Array\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromUint8Array(left, right) {\n  return IsStructuralRight(right) ? StructuralRight(left, right) : index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : index_10.TypeGuard.IsUint8Array(right) ? ExtendsResult.True : ExtendsResult.False;\n}\n// ------------------------------------------------------------------\n// Undefined\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromUndefined(left, right) {\n  return IsStructuralRight(right) ? StructuralRight(left, right) : index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : index_10.TypeGuard.IsRecord(right) ? FromRecordRight(left, right) : index_10.TypeGuard.IsVoid(right) ? FromVoidRight(left, right) : index_10.TypeGuard.IsUndefined(right) ? ExtendsResult.True : ExtendsResult.False;\n}\n// ------------------------------------------------------------------\n// Union\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromUnionRight(left, right) {\n  return right.anyOf.some(function (schema) {\n    return Visit(left, schema) === ExtendsResult.True;\n  }) ? ExtendsResult.True : ExtendsResult.False;\n}\n// prettier-ignore\nfunction FromUnion(left, right) {\n  return left.anyOf.every(function (schema) {\n    return Visit(schema, right) === ExtendsResult.True;\n  }) ? ExtendsResult.True : ExtendsResult.False;\n}\n// ------------------------------------------------------------------\n// Unknown\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromUnknownRight(left, right) {\n  return ExtendsResult.True;\n}\n// prettier-ignore\nfunction FromUnknown(left, right) {\n  return index_10.TypeGuard.IsNever(right) ? FromNeverRight(left, right) : index_10.TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) : index_10.TypeGuard.IsUnion(right) ? FromUnionRight(left, right) : index_10.TypeGuard.IsAny(right) ? FromAnyRight(left, right) : index_10.TypeGuard.IsString(right) ? FromStringRight(left, right) : index_10.TypeGuard.IsNumber(right) ? FromNumberRight(left, right) : index_10.TypeGuard.IsInteger(right) ? FromIntegerRight(left, right) : index_10.TypeGuard.IsBoolean(right) ? FromBooleanRight(left, right) : index_10.TypeGuard.IsArray(right) ? FromArrayRight(left, right) : index_10.TypeGuard.IsTuple(right) ? FromTupleRight(left, right) : index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : index_10.TypeGuard.IsUnknown(right) ? ExtendsResult.True : ExtendsResult.False;\n}\n// ------------------------------------------------------------------\n// Void\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromVoidRight(left, right) {\n  return index_10.TypeGuard.IsUndefined(left) ? ExtendsResult.True : index_10.TypeGuard.IsUndefined(left) ? ExtendsResult.True : ExtendsResult.False;\n}\n// prettier-ignore\nfunction FromVoid(left, right) {\n  return index_10.TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) : index_10.TypeGuard.IsUnion(right) ? FromUnionRight(left, right) : index_10.TypeGuard.IsUnknown(right) ? FromUnknownRight(left, right) : index_10.TypeGuard.IsAny(right) ? FromAnyRight(left, right) : index_10.TypeGuard.IsObject(right) ? FromObjectRight(left, right) : index_10.TypeGuard.IsVoid(right) ? ExtendsResult.True : ExtendsResult.False;\n}\n// prettier-ignore\nfunction Visit(left, right) {\n  return (\n    // resolvable\n    index_10.TypeGuard.IsTemplateLiteral(left) || index_10.TypeGuard.IsTemplateLiteral(right) ? FromTemplateLiteral(left, right) : index_10.TypeGuard.IsRegExp(left) || index_10.TypeGuard.IsRegExp(right) ? FromRegExp(left, right) : index_10.TypeGuard.IsNot(left) || index_10.TypeGuard.IsNot(right) ? FromNot(left, right) :\n    // standard\n    index_10.TypeGuard.IsAny(left) ? FromAny(left, right) : index_10.TypeGuard.IsArray(left) ? FromArray(left, right) : index_10.TypeGuard.IsBigInt(left) ? FromBigInt(left, right) : index_10.TypeGuard.IsBoolean(left) ? FromBoolean(left, right) : index_10.TypeGuard.IsAsyncIterator(left) ? FromAsyncIterator(left, right) : index_10.TypeGuard.IsConstructor(left) ? FromConstructor(left, right) : index_10.TypeGuard.IsDate(left) ? FromDate(left, right) : index_10.TypeGuard.IsFunction(left) ? FromFunction(left, right) : index_10.TypeGuard.IsInteger(left) ? FromInteger(left, right) : index_10.TypeGuard.IsIntersect(left) ? FromIntersect(left, right) : index_10.TypeGuard.IsIterator(left) ? FromIterator(left, right) : index_10.TypeGuard.IsLiteral(left) ? FromLiteral(left, right) : index_10.TypeGuard.IsNever(left) ? FromNever(left, right) : index_10.TypeGuard.IsNull(left) ? FromNull(left, right) : index_10.TypeGuard.IsNumber(left) ? FromNumber(left, right) : index_10.TypeGuard.IsObject(left) ? FromObject(left, right) : index_10.TypeGuard.IsRecord(left) ? FromRecord(left, right) : index_10.TypeGuard.IsString(left) ? FromString(left, right) : index_10.TypeGuard.IsSymbol(left) ? FromSymbol(left, right) : index_10.TypeGuard.IsTuple(left) ? FromTuple(left, right) : index_10.TypeGuard.IsPromise(left) ? FromPromise(left, right) : index_10.TypeGuard.IsUint8Array(left) ? FromUint8Array(left, right) : index_10.TypeGuard.IsUndefined(left) ? FromUndefined(left, right) : index_10.TypeGuard.IsUnion(left) ? FromUnion(left, right) : index_10.TypeGuard.IsUnknown(left) ? FromUnknown(left, right) : index_10.TypeGuard.IsVoid(left) ? FromVoid(left, right) : Throw(\"Unknown left type operand '\".concat(left[index_8.Kind], \"'\"))\n  );\n}\nfunction ExtendsCheck(left, right) {\n  return Visit(left, right);\n}\n\n},{\"../any/index\":42,\"../error/index\":78,\"../function/index\":94,\"../guard/index\":95,\"../number/index\":146,\"../patterns/index\":162,\"../string/index\":200,\"../symbols/index\":204,\"../template-literal/index\":208,\"../unknown/index\":231}],84:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ExtendsFromMappedKey = ExtendsFromMappedKey;\nvar index_1 = require(\"../mapped/index\");\nvar index_2 = require(\"../literal/index\");\nvar extends_1 = require(\"./extends\");\nvar value_1 = require(\"../clone/value\");\n// prettier-ignore\nfunction FromPropertyKey(K, U, L, R, options) {\n  return _defineProperty({}, K, (0, extends_1.Extends)((0, index_2.Literal)(K), U, L, R, (0, value_1.Clone)(options)));\n}\n// prettier-ignore\nfunction FromPropertyKeys(K, U, L, R, options) {\n  return K.reduce(function (Acc, LK) {\n    return _objectSpread(_objectSpread({}, Acc), FromPropertyKey(LK, U, L, R, options));\n  }, {});\n}\n// prettier-ignore\nfunction FromMappedKey(K, U, L, R, options) {\n  return FromPropertyKeys(K.keys, U, L, R, options);\n}\n// prettier-ignore\nfunction ExtendsFromMappedKey(T, U, L, R, options) {\n  var P = FromMappedKey(T, U, L, R, options);\n  return (0, index_1.MappedResult)(P);\n}\n\n},{\"../clone/value\":57,\"../literal/index\":131,\"../mapped/index\":133,\"./extends\":87}],85:[function(require,module,exports){\n\"use strict\";\n\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ExtendsFromMappedResult = ExtendsFromMappedResult;\nvar index_1 = require(\"../mapped/index\");\nvar extends_1 = require(\"./extends\");\nvar value_1 = require(\"../clone/value\");\n// prettier-ignore\nfunction FromProperties(P, Right, True, False, options) {\n  var Acc = {};\n  var _iterator = _createForOfIteratorHelper(globalThis.Object.getOwnPropertyNames(P)),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var K2 = _step.value;\n      Acc[K2] = (0, extends_1.Extends)(P[K2], Right, True, False, (0, value_1.Clone)(options));\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return Acc;\n}\n// prettier-ignore\nfunction FromMappedResult(Left, Right, True, False, options) {\n  return FromProperties(Left.properties, Right, True, False, options);\n}\n// prettier-ignore\nfunction ExtendsFromMappedResult(Left, Right, True, False, options) {\n  var P = FromMappedResult(Left, Right, True, False, options);\n  return (0, index_1.MappedResult)(P);\n}\n\n},{\"../clone/value\":57,\"../mapped/index\":133,\"./extends\":87}],86:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ExtendsUndefinedCheck = ExtendsUndefinedCheck;\nvar index_1 = require(\"../symbols/index\");\n/** Fast undefined check used for properties of type undefined */\nfunction Intersect(schema) {\n  return schema.allOf.every(function (schema) {\n    return ExtendsUndefinedCheck(schema);\n  });\n}\nfunction Union(schema) {\n  return schema.anyOf.some(function (schema) {\n    return ExtendsUndefinedCheck(schema);\n  });\n}\nfunction Not(schema) {\n  return !ExtendsUndefinedCheck(schema.not);\n}\n/** Fast undefined check used for properties of type undefined */\n// prettier-ignore\nfunction ExtendsUndefinedCheck(schema) {\n  return schema[index_1.Kind] === 'Intersect' ? Intersect(schema) : schema[index_1.Kind] === 'Union' ? Union(schema) : schema[index_1.Kind] === 'Not' ? Not(schema) : schema[index_1.Kind] === 'Undefined' ? true : false;\n}\n\n},{\"../symbols/index\":204}],87:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Extends = Extends;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../union/index\");\nvar extends_check_1 = require(\"./extends-check\");\nvar extends_from_mapped_key_1 = require(\"./extends-from-mapped-key\");\nvar extends_from_mapped_result_1 = require(\"./extends-from-mapped-result\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\n// prettier-ignore\nfunction ExtendsResolve(left, right, trueType, falseType) {\n  var R = (0, extends_check_1.ExtendsCheck)(left, right);\n  return R === extends_check_1.ExtendsResult.Union ? (0, index_1.Union)([trueType, falseType]) : R === extends_check_1.ExtendsResult.True ? trueType : falseType;\n}\n/** `[Json]` Creates a Conditional type */\nfunction Extends(L, R, T, F, options) {\n  // prettier-ignore\n  return (0, kind_1.IsMappedResult)(L) ? (0, extends_from_mapped_result_1.ExtendsFromMappedResult)(L, R, T, F, options) : (0, kind_1.IsMappedKey)(L) ? (0, type_1.CreateType)((0, extends_from_mapped_key_1.ExtendsFromMappedKey)(L, R, T, F, options)) : (0, type_1.CreateType)(ExtendsResolve(L, R, T, F), options);\n}\n\n},{\"../create/type\":70,\"../guard/kind\":96,\"../union/index\":226,\"./extends-check\":83,\"./extends-from-mapped-key\":84,\"./extends-from-mapped-result\":85}],88:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./extends-check\"), exports);\n__exportStar(require(\"./extends-from-mapped-key\"), exports);\n__exportStar(require(\"./extends-from-mapped-result\"), exports);\n__exportStar(require(\"./extends-undefined\"), exports);\n__exportStar(require(\"./extends\"), exports);\n\n},{\"./extends\":87,\"./extends-check\":83,\"./extends-from-mapped-key\":84,\"./extends-from-mapped-result\":85,\"./extends-undefined\":86}],89:[function(require,module,exports){\n\"use strict\";\n\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ExtractFromMappedResult = ExtractFromMappedResult;\nvar index_1 = require(\"../mapped/index\");\nvar extract_1 = require(\"./extract\");\n// prettier-ignore\nfunction FromProperties(P, T) {\n  var Acc = {};\n  var _iterator = _createForOfIteratorHelper(globalThis.Object.getOwnPropertyNames(P)),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var K2 = _step.value;\n      Acc[K2] = (0, extract_1.Extract)(P[K2], T);\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return Acc;\n}\n// prettier-ignore\nfunction FromMappedResult(R, T) {\n  return FromProperties(R.properties, T);\n}\n// prettier-ignore\nfunction ExtractFromMappedResult(R, T) {\n  var P = FromMappedResult(R, T);\n  return (0, index_1.MappedResult)(P);\n}\n\n},{\"../mapped/index\":133,\"./extract\":91}],90:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ExtractFromTemplateLiteral = ExtractFromTemplateLiteral;\nvar extract_1 = require(\"./extract\");\nvar index_1 = require(\"../template-literal/index\");\nfunction ExtractFromTemplateLiteral(L, R) {\n  return (0, extract_1.Extract)((0, index_1.TemplateLiteralToUnion)(L), R);\n}\n\n},{\"../template-literal/index\":208,\"./extract\":91}],91:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Extract = Extract;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../union/index\");\nvar index_2 = require(\"../never/index\");\nvar index_3 = require(\"../extends/index\");\nvar extract_from_mapped_result_1 = require(\"./extract-from-mapped-result\");\nvar extract_from_template_literal_1 = require(\"./extract-from-template-literal\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\nfunction ExtractRest(L, R) {\n  var extracted = L.filter(function (inner) {\n    return (0, index_3.ExtendsCheck)(inner, R) !== index_3.ExtendsResult.False;\n  });\n  return extracted.length === 1 ? extracted[0] : (0, index_1.Union)(extracted);\n}\n/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */\nfunction Extract(L, R, options) {\n  // overloads\n  if ((0, kind_1.IsTemplateLiteral)(L)) return (0, type_1.CreateType)((0, extract_from_template_literal_1.ExtractFromTemplateLiteral)(L, R), options);\n  if ((0, kind_1.IsMappedResult)(L)) return (0, type_1.CreateType)((0, extract_from_mapped_result_1.ExtractFromMappedResult)(L, R), options);\n  // prettier-ignore\n  return (0, type_1.CreateType)((0, kind_1.IsUnion)(L) ? ExtractRest(L.anyOf, R) : (0, index_3.ExtendsCheck)(L, R) !== index_3.ExtendsResult.False ? L : (0, index_2.Never)(), options);\n}\n\n},{\"../create/type\":70,\"../extends/index\":88,\"../guard/kind\":96,\"../never/index\":140,\"../union/index\":226,\"./extract-from-mapped-result\":89,\"./extract-from-template-literal\":90}],92:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./extract-from-mapped-result\"), exports);\n__exportStar(require(\"./extract-from-template-literal\"), exports);\n__exportStar(require(\"./extract\"), exports);\n\n},{\"./extract\":91,\"./extract-from-mapped-result\":89,\"./extract-from-template-literal\":90}],93:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Function = Function;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[JavaScript]` Creates a Function type */\nfunction Function(parameters, returns, options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, index_1.Kind, 'Function'), \"type\", 'Function'), \"parameters\", parameters), \"returns\", returns), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],94:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./function\"), exports);\n\n},{\"./function\":93}],95:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ValueGuard = exports.TypeGuard = exports.KindGuard = void 0;\nexports.KindGuard = require(\"./kind\");\nexports.TypeGuard = require(\"./type\");\nexports.ValueGuard = require(\"./value\");\n\n},{\"./kind\":96,\"./type\":97,\"./value\":98}],96:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.IsReadonly = IsReadonly;\nexports.IsOptional = IsOptional;\nexports.IsAny = IsAny;\nexports.IsArgument = IsArgument;\nexports.IsArray = IsArray;\nexports.IsAsyncIterator = IsAsyncIterator;\nexports.IsBigInt = IsBigInt;\nexports.IsBoolean = IsBoolean;\nexports.IsComputed = IsComputed;\nexports.IsConstructor = IsConstructor;\nexports.IsDate = IsDate;\nexports.IsFunction = IsFunction;\nexports.IsImport = IsImport;\nexports.IsInteger = IsInteger;\nexports.IsProperties = IsProperties;\nexports.IsIntersect = IsIntersect;\nexports.IsIterator = IsIterator;\nexports.IsKindOf = IsKindOf;\nexports.IsLiteralString = IsLiteralString;\nexports.IsLiteralNumber = IsLiteralNumber;\nexports.IsLiteralBoolean = IsLiteralBoolean;\nexports.IsLiteralValue = IsLiteralValue;\nexports.IsLiteral = IsLiteral;\nexports.IsMappedKey = IsMappedKey;\nexports.IsMappedResult = IsMappedResult;\nexports.IsNever = IsNever;\nexports.IsNot = IsNot;\nexports.IsNull = IsNull;\nexports.IsNumber = IsNumber;\nexports.IsObject = IsObject;\nexports.IsPromise = IsPromise;\nexports.IsRecord = IsRecord;\nexports.IsRecursive = IsRecursive;\nexports.IsRef = IsRef;\nexports.IsRegExp = IsRegExp;\nexports.IsString = IsString;\nexports.IsSymbol = IsSymbol;\nexports.IsTemplateLiteral = IsTemplateLiteral;\nexports.IsThis = IsThis;\nexports.IsTransform = IsTransform;\nexports.IsTuple = IsTuple;\nexports.IsUndefined = IsUndefined;\nexports.IsUnion = IsUnion;\nexports.IsUint8Array = IsUint8Array;\nexports.IsUnknown = IsUnknown;\nexports.IsUnsafe = IsUnsafe;\nexports.IsVoid = IsVoid;\nexports.IsKind = IsKind;\nexports.IsSchema = IsSchema;\nvar ValueGuard = require(\"./value\");\nvar index_1 = require(\"../symbols/index\");\n/** `[Kind-Only]` Returns true if this value has a Readonly symbol */\nfunction IsReadonly(value) {\n  return ValueGuard.IsObject(value) && value[index_1.ReadonlyKind] === 'Readonly';\n}\n/** `[Kind-Only]` Returns true if this value has a Optional symbol */\nfunction IsOptional(value) {\n  return ValueGuard.IsObject(value) && value[index_1.OptionalKind] === 'Optional';\n}\n/** `[Kind-Only]` Returns true if the given value is TAny */\nfunction IsAny(value) {\n  return IsKindOf(value, 'Any');\n}\n/** `[Kind-Only]` Returns true if the given value is TArgument */\nfunction IsArgument(value) {\n  return IsKindOf(value, 'Argument');\n}\n/** `[Kind-Only]` Returns true if the given value is TArray */\nfunction IsArray(value) {\n  return IsKindOf(value, 'Array');\n}\n/** `[Kind-Only]` Returns true if the given value is TAsyncIterator */\nfunction IsAsyncIterator(value) {\n  return IsKindOf(value, 'AsyncIterator');\n}\n/** `[Kind-Only]` Returns true if the given value is TBigInt */\nfunction IsBigInt(value) {\n  return IsKindOf(value, 'BigInt');\n}\n/** `[Kind-Only]` Returns true if the given value is TBoolean */\nfunction IsBoolean(value) {\n  return IsKindOf(value, 'Boolean');\n}\n/** `[Kind-Only]` Returns true if the given value is TComputed */\nfunction IsComputed(value) {\n  return IsKindOf(value, 'Computed');\n}\n/** `[Kind-Only]` Returns true if the given value is TConstructor */\nfunction IsConstructor(value) {\n  return IsKindOf(value, 'Constructor');\n}\n/** `[Kind-Only]` Returns true if the given value is TDate */\nfunction IsDate(value) {\n  return IsKindOf(value, 'Date');\n}\n/** `[Kind-Only]` Returns true if the given value is TFunction */\nfunction IsFunction(value) {\n  return IsKindOf(value, 'Function');\n}\n/** `[Kind-Only]` Returns true if the given value is TInteger */\nfunction IsImport(value) {\n  return IsKindOf(value, 'Import');\n}\n/** `[Kind-Only]` Returns true if the given value is TInteger */\nfunction IsInteger(value) {\n  return IsKindOf(value, 'Integer');\n}\n/** `[Kind-Only]` Returns true if the given schema is TProperties */\nfunction IsProperties(value) {\n  return ValueGuard.IsObject(value);\n}\n/** `[Kind-Only]` Returns true if the given value is TIntersect */\nfunction IsIntersect(value) {\n  return IsKindOf(value, 'Intersect');\n}\n/** `[Kind-Only]` Returns true if the given value is TIterator */\nfunction IsIterator(value) {\n  return IsKindOf(value, 'Iterator');\n}\n/** `[Kind-Only]` Returns true if the given value is a TKind with the given name. */\nfunction IsKindOf(value, kind) {\n  return ValueGuard.IsObject(value) && index_1.Kind in value && value[index_1.Kind] === kind;\n}\n/** `[Kind-Only]` Returns true if the given value is TLiteral<string> */\nfunction IsLiteralString(value) {\n  return IsLiteral(value) && ValueGuard.IsString(value[\"const\"]);\n}\n/** `[Kind-Only]` Returns true if the given value is TLiteral<number> */\nfunction IsLiteralNumber(value) {\n  return IsLiteral(value) && ValueGuard.IsNumber(value[\"const\"]);\n}\n/** `[Kind-Only]` Returns true if the given value is TLiteral<boolean> */\nfunction IsLiteralBoolean(value) {\n  return IsLiteral(value) && ValueGuard.IsBoolean(value[\"const\"]);\n}\n/** `[Kind-Only]` Returns true if the given value is TLiteralValue */\nfunction IsLiteralValue(value) {\n  return ValueGuard.IsBoolean(value) || ValueGuard.IsNumber(value) || ValueGuard.IsString(value);\n}\n/** `[Kind-Only]` Returns true if the given value is TLiteral */\nfunction IsLiteral(value) {\n  return IsKindOf(value, 'Literal');\n}\n/** `[Kind-Only]` Returns true if the given value is a TMappedKey */\nfunction IsMappedKey(value) {\n  return IsKindOf(value, 'MappedKey');\n}\n/** `[Kind-Only]` Returns true if the given value is TMappedResult */\nfunction IsMappedResult(value) {\n  return IsKindOf(value, 'MappedResult');\n}\n/** `[Kind-Only]` Returns true if the given value is TNever */\nfunction IsNever(value) {\n  return IsKindOf(value, 'Never');\n}\n/** `[Kind-Only]` Returns true if the given value is TNot */\nfunction IsNot(value) {\n  return IsKindOf(value, 'Not');\n}\n/** `[Kind-Only]` Returns true if the given value is TNull */\nfunction IsNull(value) {\n  return IsKindOf(value, 'Null');\n}\n/** `[Kind-Only]` Returns true if the given value is TNumber */\nfunction IsNumber(value) {\n  return IsKindOf(value, 'Number');\n}\n/** `[Kind-Only]` Returns true if the given value is TObject */\nfunction IsObject(value) {\n  return IsKindOf(value, 'Object');\n}\n/** `[Kind-Only]` Returns true if the given value is TPromise */\nfunction IsPromise(value) {\n  return IsKindOf(value, 'Promise');\n}\n/** `[Kind-Only]` Returns true if the given value is TRecord */\nfunction IsRecord(value) {\n  return IsKindOf(value, 'Record');\n}\n/** `[Kind-Only]` Returns true if this value is TRecursive */\nfunction IsRecursive(value) {\n  return ValueGuard.IsObject(value) && index_1.Hint in value && value[index_1.Hint] === 'Recursive';\n}\n/** `[Kind-Only]` Returns true if the given value is TRef */\nfunction IsRef(value) {\n  return IsKindOf(value, 'Ref');\n}\n/** `[Kind-Only]` Returns true if the given value is TRegExp */\nfunction IsRegExp(value) {\n  return IsKindOf(value, 'RegExp');\n}\n/** `[Kind-Only]` Returns true if the given value is TString */\nfunction IsString(value) {\n  return IsKindOf(value, 'String');\n}\n/** `[Kind-Only]` Returns true if the given value is TSymbol */\nfunction IsSymbol(value) {\n  return IsKindOf(value, 'Symbol');\n}\n/** `[Kind-Only]` Returns true if the given value is TTemplateLiteral */\nfunction IsTemplateLiteral(value) {\n  return IsKindOf(value, 'TemplateLiteral');\n}\n/** `[Kind-Only]` Returns true if the given value is TThis */\nfunction IsThis(value) {\n  return IsKindOf(value, 'This');\n}\n/** `[Kind-Only]` Returns true of this value is TTransform */\nfunction IsTransform(value) {\n  return ValueGuard.IsObject(value) && index_1.TransformKind in value;\n}\n/** `[Kind-Only]` Returns true if the given value is TTuple */\nfunction IsTuple(value) {\n  return IsKindOf(value, 'Tuple');\n}\n/** `[Kind-Only]` Returns true if the given value is TUndefined */\nfunction IsUndefined(value) {\n  return IsKindOf(value, 'Undefined');\n}\n/** `[Kind-Only]` Returns true if the given value is TUnion */\nfunction IsUnion(value) {\n  return IsKindOf(value, 'Union');\n}\n/** `[Kind-Only]` Returns true if the given value is TUint8Array */\nfunction IsUint8Array(value) {\n  return IsKindOf(value, 'Uint8Array');\n}\n/** `[Kind-Only]` Returns true if the given value is TUnknown */\nfunction IsUnknown(value) {\n  return IsKindOf(value, 'Unknown');\n}\n/** `[Kind-Only]` Returns true if the given value is a raw TUnsafe */\nfunction IsUnsafe(value) {\n  return IsKindOf(value, 'Unsafe');\n}\n/** `[Kind-Only]` Returns true if the given value is TVoid */\nfunction IsVoid(value) {\n  return IsKindOf(value, 'Void');\n}\n/** `[Kind-Only]` Returns true if the given value is TKind */\nfunction IsKind(value) {\n  return ValueGuard.IsObject(value) && index_1.Kind in value && ValueGuard.IsString(value[index_1.Kind]);\n}\n/** `[Kind-Only]` Returns true if the given value is TSchema */\nfunction IsSchema(value) {\n  // prettier-ignore\n  return IsAny(value) || IsArgument(value) || IsArray(value) || IsBoolean(value) || IsBigInt(value) || IsAsyncIterator(value) || IsComputed(value) || IsConstructor(value) || IsDate(value) || IsFunction(value) || IsInteger(value) || IsIntersect(value) || IsIterator(value) || IsLiteral(value) || IsMappedKey(value) || IsMappedResult(value) || IsNever(value) || IsNot(value) || IsNull(value) || IsNumber(value) || IsObject(value) || IsPromise(value) || IsRecord(value) || IsRef(value) || IsRegExp(value) || IsString(value) || IsSymbol(value) || IsTemplateLiteral(value) || IsThis(value) || IsTuple(value) || IsUndefined(value) || IsUnion(value) || IsUint8Array(value) || IsUnknown(value) || IsUnsafe(value) || IsVoid(value) || IsKind(value);\n}\n\n},{\"../symbols/index\":204,\"./value\":98}],97:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TypeGuardUnknownTypeError = void 0;\nexports.IsReadonly = IsReadonly;\nexports.IsOptional = IsOptional;\nexports.IsAny = IsAny;\nexports.IsArgument = IsArgument;\nexports.IsArray = IsArray;\nexports.IsAsyncIterator = IsAsyncIterator;\nexports.IsBigInt = IsBigInt;\nexports.IsBoolean = IsBoolean;\nexports.IsComputed = IsComputed;\nexports.IsConstructor = IsConstructor;\nexports.IsDate = IsDate;\nexports.IsFunction = IsFunction;\nexports.IsImport = IsImport;\nexports.IsInteger = IsInteger;\nexports.IsProperties = IsProperties;\nexports.IsIntersect = IsIntersect;\nexports.IsIterator = IsIterator;\nexports.IsKindOf = IsKindOf;\nexports.IsLiteralString = IsLiteralString;\nexports.IsLiteralNumber = IsLiteralNumber;\nexports.IsLiteralBoolean = IsLiteralBoolean;\nexports.IsLiteral = IsLiteral;\nexports.IsLiteralValue = IsLiteralValue;\nexports.IsMappedKey = IsMappedKey;\nexports.IsMappedResult = IsMappedResult;\nexports.IsNever = IsNever;\nexports.IsNot = IsNot;\nexports.IsNull = IsNull;\nexports.IsNumber = IsNumber;\nexports.IsObject = IsObject;\nexports.IsPromise = IsPromise;\nexports.IsRecord = IsRecord;\nexports.IsRecursive = IsRecursive;\nexports.IsRef = IsRef;\nexports.IsRegExp = IsRegExp;\nexports.IsString = IsString;\nexports.IsSymbol = IsSymbol;\nexports.IsTemplateLiteral = IsTemplateLiteral;\nexports.IsThis = IsThis;\nexports.IsTransform = IsTransform;\nexports.IsTuple = IsTuple;\nexports.IsUndefined = IsUndefined;\nexports.IsUnionLiteral = IsUnionLiteral;\nexports.IsUnion = IsUnion;\nexports.IsUint8Array = IsUint8Array;\nexports.IsUnknown = IsUnknown;\nexports.IsUnsafe = IsUnsafe;\nexports.IsVoid = IsVoid;\nexports.IsKind = IsKind;\nexports.IsSchema = IsSchema;\nvar ValueGuard = require(\"./value\");\nvar index_1 = require(\"../symbols/index\");\nvar index_2 = require(\"../error/index\");\nvar TypeGuardUnknownTypeError = /*#__PURE__*/function (_index_2$TypeBoxError) {\n  function TypeGuardUnknownTypeError() {\n    _classCallCheck(this, TypeGuardUnknownTypeError);\n    return _callSuper(this, TypeGuardUnknownTypeError, arguments);\n  }\n  _inherits(TypeGuardUnknownTypeError, _index_2$TypeBoxError);\n  return _createClass(TypeGuardUnknownTypeError);\n}(index_2.TypeBoxError);\nexports.TypeGuardUnknownTypeError = TypeGuardUnknownTypeError;\nvar KnownTypes = ['Argument', 'Any', 'Array', 'AsyncIterator', 'BigInt', 'Boolean', 'Computed', 'Constructor', 'Date', 'Enum', 'Function', 'Integer', 'Intersect', 'Iterator', 'Literal', 'MappedKey', 'MappedResult', 'Not', 'Null', 'Number', 'Object', 'Promise', 'Record', 'Ref', 'RegExp', 'String', 'Symbol', 'TemplateLiteral', 'This', 'Tuple', 'Undefined', 'Union', 'Uint8Array', 'Unknown', 'Void'];\nfunction IsPattern(value) {\n  try {\n    new RegExp(value);\n    return true;\n  } catch (_unused) {\n    return false;\n  }\n}\nfunction IsControlCharacterFree(value) {\n  if (!ValueGuard.IsString(value)) return false;\n  for (var i = 0; i < value.length; i++) {\n    var code = value.charCodeAt(i);\n    if (code >= 7 && code <= 13 || code === 27 || code === 127) {\n      return false;\n    }\n  }\n  return true;\n}\nfunction IsAdditionalProperties(value) {\n  return IsOptionalBoolean(value) || IsSchema(value);\n}\nfunction IsOptionalBigInt(value) {\n  return ValueGuard.IsUndefined(value) || ValueGuard.IsBigInt(value);\n}\nfunction IsOptionalNumber(value) {\n  return ValueGuard.IsUndefined(value) || ValueGuard.IsNumber(value);\n}\nfunction IsOptionalBoolean(value) {\n  return ValueGuard.IsUndefined(value) || ValueGuard.IsBoolean(value);\n}\nfunction IsOptionalString(value) {\n  return ValueGuard.IsUndefined(value) || ValueGuard.IsString(value);\n}\nfunction IsOptionalPattern(value) {\n  return ValueGuard.IsUndefined(value) || ValueGuard.IsString(value) && IsControlCharacterFree(value) && IsPattern(value);\n}\nfunction IsOptionalFormat(value) {\n  return ValueGuard.IsUndefined(value) || ValueGuard.IsString(value) && IsControlCharacterFree(value);\n}\nfunction IsOptionalSchema(value) {\n  return ValueGuard.IsUndefined(value) || IsSchema(value);\n}\n// ------------------------------------------------------------------\n// Modifiers\n// ------------------------------------------------------------------\n/** Returns true if this value has a Readonly symbol */\nfunction IsReadonly(value) {\n  return ValueGuard.IsObject(value) && value[index_1.ReadonlyKind] === 'Readonly';\n}\n/** Returns true if this value has a Optional symbol */\nfunction IsOptional(value) {\n  return ValueGuard.IsObject(value) && value[index_1.OptionalKind] === 'Optional';\n}\n// ------------------------------------------------------------------\n// Types\n// ------------------------------------------------------------------\n/** Returns true if the given value is TAny */\nfunction IsAny(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Any') && IsOptionalString(value.$id);\n}\n/** Returns true if the given value is TArgument */\nfunction IsArgument(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Argument') && ValueGuard.IsNumber(value.index);\n}\n/** Returns true if the given value is TArray */\nfunction IsArray(value) {\n  return IsKindOf(value, 'Array') && value.type === 'array' && IsOptionalString(value.$id) && IsSchema(value.items) && IsOptionalNumber(value.minItems) && IsOptionalNumber(value.maxItems) && IsOptionalBoolean(value.uniqueItems) && IsOptionalSchema(value.contains) && IsOptionalNumber(value.minContains) && IsOptionalNumber(value.maxContains);\n}\n/** Returns true if the given value is TAsyncIterator */\nfunction IsAsyncIterator(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'AsyncIterator') && value.type === 'AsyncIterator' && IsOptionalString(value.$id) && IsSchema(value.items);\n}\n/** Returns true if the given value is TBigInt */\nfunction IsBigInt(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'BigInt') && value.type === 'bigint' && IsOptionalString(value.$id) && IsOptionalBigInt(value.exclusiveMaximum) && IsOptionalBigInt(value.exclusiveMinimum) && IsOptionalBigInt(value.maximum) && IsOptionalBigInt(value.minimum) && IsOptionalBigInt(value.multipleOf);\n}\n/** Returns true if the given value is TBoolean */\nfunction IsBoolean(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Boolean') && value.type === 'boolean' && IsOptionalString(value.$id);\n}\n/** Returns true if the given value is TComputed */\nfunction IsComputed(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Computed') && ValueGuard.IsString(value.target) && ValueGuard.IsArray(value.parameters) && value.parameters.every(function (schema) {\n    return IsSchema(schema);\n  });\n}\n/** Returns true if the given value is TConstructor */\nfunction IsConstructor(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Constructor') && value.type === 'Constructor' && IsOptionalString(value.$id) && ValueGuard.IsArray(value.parameters) && value.parameters.every(function (schema) {\n    return IsSchema(schema);\n  }) && IsSchema(value.returns);\n}\n/** Returns true if the given value is TDate */\nfunction IsDate(value) {\n  return IsKindOf(value, 'Date') && value.type === 'Date' && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximumTimestamp) && IsOptionalNumber(value.exclusiveMinimumTimestamp) && IsOptionalNumber(value.maximumTimestamp) && IsOptionalNumber(value.minimumTimestamp) && IsOptionalNumber(value.multipleOfTimestamp);\n}\n/** Returns true if the given value is TFunction */\nfunction IsFunction(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Function') && value.type === 'Function' && IsOptionalString(value.$id) && ValueGuard.IsArray(value.parameters) && value.parameters.every(function (schema) {\n    return IsSchema(schema);\n  }) && IsSchema(value.returns);\n}\n/** Returns true if the given value is TImport */\nfunction IsImport(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Import') && ValueGuard.HasPropertyKey(value, '$defs') && ValueGuard.IsObject(value.$defs) && IsProperties(value.$defs) && ValueGuard.HasPropertyKey(value, '$ref') && ValueGuard.IsString(value.$ref) && value.$ref in value.$defs // required\n  ;\n}\n/** Returns true if the given value is TInteger */\nfunction IsInteger(value) {\n  return IsKindOf(value, 'Integer') && value.type === 'integer' && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);\n}\n/** Returns true if the given schema is TProperties */\nfunction IsProperties(value) {\n  // prettier-ignore\n  return ValueGuard.IsObject(value) && Object.entries(value).every(function (_ref) {\n    var _ref2 = _slicedToArray(_ref, 2),\n      key = _ref2[0],\n      schema = _ref2[1];\n    return IsControlCharacterFree(key) && IsSchema(schema);\n  });\n}\n/** Returns true if the given value is TIntersect */\nfunction IsIntersect(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Intersect') && (ValueGuard.IsString(value.type) && value.type !== 'object' ? false : true) && ValueGuard.IsArray(value.allOf) && value.allOf.every(function (schema) {\n    return IsSchema(schema) && !IsTransform(schema);\n  }) && IsOptionalString(value.type) && (IsOptionalBoolean(value.unevaluatedProperties) || IsOptionalSchema(value.unevaluatedProperties)) && IsOptionalString(value.$id);\n}\n/** Returns true if the given value is TIterator */\nfunction IsIterator(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Iterator') && value.type === 'Iterator' && IsOptionalString(value.$id) && IsSchema(value.items);\n}\n/** Returns true if the given value is a TKind with the given name. */\nfunction IsKindOf(value, kind) {\n  return ValueGuard.IsObject(value) && index_1.Kind in value && value[index_1.Kind] === kind;\n}\n/** Returns true if the given value is TLiteral<string> */\nfunction IsLiteralString(value) {\n  return IsLiteral(value) && ValueGuard.IsString(value[\"const\"]);\n}\n/** Returns true if the given value is TLiteral<number> */\nfunction IsLiteralNumber(value) {\n  return IsLiteral(value) && ValueGuard.IsNumber(value[\"const\"]);\n}\n/** Returns true if the given value is TLiteral<boolean> */\nfunction IsLiteralBoolean(value) {\n  return IsLiteral(value) && ValueGuard.IsBoolean(value[\"const\"]);\n}\n/** Returns true if the given value is TLiteral */\nfunction IsLiteral(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Literal') && IsOptionalString(value.$id) && IsLiteralValue(value[\"const\"]);\n}\n/** Returns true if the given value is a TLiteralValue */\nfunction IsLiteralValue(value) {\n  return ValueGuard.IsBoolean(value) || ValueGuard.IsNumber(value) || ValueGuard.IsString(value);\n}\n/** Returns true if the given value is a TMappedKey */\nfunction IsMappedKey(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'MappedKey') && ValueGuard.IsArray(value.keys) && value.keys.every(function (key) {\n    return ValueGuard.IsNumber(key) || ValueGuard.IsString(key);\n  });\n}\n/** Returns true if the given value is TMappedResult */\nfunction IsMappedResult(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'MappedResult') && IsProperties(value.properties);\n}\n/** Returns true if the given value is TNever */\nfunction IsNever(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Never') && ValueGuard.IsObject(value.not) && Object.getOwnPropertyNames(value.not).length === 0;\n}\n/** Returns true if the given value is TNot */\nfunction IsNot(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Not') && IsSchema(value.not);\n}\n/** Returns true if the given value is TNull */\nfunction IsNull(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Null') && value.type === 'null' && IsOptionalString(value.$id);\n}\n/** Returns true if the given value is TNumber */\nfunction IsNumber(value) {\n  return IsKindOf(value, 'Number') && value.type === 'number' && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);\n}\n/** Returns true if the given value is TObject */\nfunction IsObject(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Object') && value.type === 'object' && IsOptionalString(value.$id) && IsProperties(value.properties) && IsAdditionalProperties(value.additionalProperties) && IsOptionalNumber(value.minProperties) && IsOptionalNumber(value.maxProperties);\n}\n/** Returns true if the given value is TPromise */\nfunction IsPromise(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Promise') && value.type === 'Promise' && IsOptionalString(value.$id) && IsSchema(value.item);\n}\n/** Returns true if the given value is TRecord */\nfunction IsRecord(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Record') && value.type === 'object' && IsOptionalString(value.$id) && IsAdditionalProperties(value.additionalProperties) && ValueGuard.IsObject(value.patternProperties) && function (schema) {\n    var keys = Object.getOwnPropertyNames(schema.patternProperties);\n    return keys.length === 1 && IsPattern(keys[0]) && ValueGuard.IsObject(schema.patternProperties) && IsSchema(schema.patternProperties[keys[0]]);\n  }(value);\n}\n/** Returns true if this value is TRecursive */\nfunction IsRecursive(value) {\n  return ValueGuard.IsObject(value) && index_1.Hint in value && value[index_1.Hint] === 'Recursive';\n}\n/** Returns true if the given value is TRef */\nfunction IsRef(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Ref') && IsOptionalString(value.$id) && ValueGuard.IsString(value.$ref);\n}\n/** Returns true if the given value is TRegExp */\nfunction IsRegExp(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'RegExp') && IsOptionalString(value.$id) && ValueGuard.IsString(value.source) && ValueGuard.IsString(value.flags) && IsOptionalNumber(value.maxLength) && IsOptionalNumber(value.minLength);\n}\n/** Returns true if the given value is TString */\nfunction IsString(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'String') && value.type === 'string' && IsOptionalString(value.$id) && IsOptionalNumber(value.minLength) && IsOptionalNumber(value.maxLength) && IsOptionalPattern(value.pattern) && IsOptionalFormat(value.format);\n}\n/** Returns true if the given value is TSymbol */\nfunction IsSymbol(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Symbol') && value.type === 'symbol' && IsOptionalString(value.$id);\n}\n/** Returns true if the given value is TTemplateLiteral */\nfunction IsTemplateLiteral(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'TemplateLiteral') && value.type === 'string' && ValueGuard.IsString(value.pattern) && value.pattern[0] === '^' && value.pattern[value.pattern.length - 1] === '$';\n}\n/** Returns true if the given value is TThis */\nfunction IsThis(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'This') && IsOptionalString(value.$id) && ValueGuard.IsString(value.$ref);\n}\n/** Returns true of this value is TTransform */\nfunction IsTransform(value) {\n  return ValueGuard.IsObject(value) && index_1.TransformKind in value;\n}\n/** Returns true if the given value is TTuple */\nfunction IsTuple(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Tuple') && value.type === 'array' && IsOptionalString(value.$id) && ValueGuard.IsNumber(value.minItems) && ValueGuard.IsNumber(value.maxItems) && value.minItems === value.maxItems && (\n  // empty\n  ValueGuard.IsUndefined(value.items) && ValueGuard.IsUndefined(value.additionalItems) && value.minItems === 0 || ValueGuard.IsArray(value.items) && value.items.every(function (schema) {\n    return IsSchema(schema);\n  }));\n}\n/** Returns true if the given value is TUndefined */\nfunction IsUndefined(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Undefined') && value.type === 'undefined' && IsOptionalString(value.$id);\n}\n/** Returns true if the given value is TUnion<Literal<string | number>[]> */\nfunction IsUnionLiteral(value) {\n  return IsUnion(value) && value.anyOf.every(function (schema) {\n    return IsLiteralString(schema) || IsLiteralNumber(schema);\n  });\n}\n/** Returns true if the given value is TUnion */\nfunction IsUnion(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Union') && IsOptionalString(value.$id) && ValueGuard.IsObject(value) && ValueGuard.IsArray(value.anyOf) && value.anyOf.every(function (schema) {\n    return IsSchema(schema);\n  });\n}\n/** Returns true if the given value is TUint8Array */\nfunction IsUint8Array(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Uint8Array') && value.type === 'Uint8Array' && IsOptionalString(value.$id) && IsOptionalNumber(value.minByteLength) && IsOptionalNumber(value.maxByteLength);\n}\n/** Returns true if the given value is TUnknown */\nfunction IsUnknown(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Unknown') && IsOptionalString(value.$id);\n}\n/** Returns true if the given value is a raw TUnsafe */\nfunction IsUnsafe(value) {\n  return IsKindOf(value, 'Unsafe');\n}\n/** Returns true if the given value is TVoid */\nfunction IsVoid(value) {\n  // prettier-ignore\n  return IsKindOf(value, 'Void') && value.type === 'void' && IsOptionalString(value.$id);\n}\n/** Returns true if the given value is TKind */\nfunction IsKind(value) {\n  return ValueGuard.IsObject(value) && index_1.Kind in value && ValueGuard.IsString(value[index_1.Kind]) && !KnownTypes.includes(value[index_1.Kind]);\n}\n/** Returns true if the given value is TSchema */\nfunction IsSchema(value) {\n  // prettier-ignore\n  return ValueGuard.IsObject(value) && (IsAny(value) || IsArgument(value) || IsArray(value) || IsBoolean(value) || IsBigInt(value) || IsAsyncIterator(value) || IsComputed(value) || IsConstructor(value) || IsDate(value) || IsFunction(value) || IsInteger(value) || IsIntersect(value) || IsIterator(value) || IsLiteral(value) || IsMappedKey(value) || IsMappedResult(value) || IsNever(value) || IsNot(value) || IsNull(value) || IsNumber(value) || IsObject(value) || IsPromise(value) || IsRecord(value) || IsRef(value) || IsRegExp(value) || IsString(value) || IsSymbol(value) || IsTemplateLiteral(value) || IsThis(value) || IsTuple(value) || IsUndefined(value) || IsUnion(value) || IsUint8Array(value) || IsUnknown(value) || IsUnsafe(value) || IsVoid(value) || IsKind(value));\n}\n\n},{\"../error/index\":78,\"../symbols/index\":204,\"./value\":98}],98:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.HasPropertyKey = HasPropertyKey;\nexports.IsAsyncIterator = IsAsyncIterator;\nexports.IsArray = IsArray;\nexports.IsBigInt = IsBigInt;\nexports.IsBoolean = IsBoolean;\nexports.IsDate = IsDate;\nexports.IsFunction = IsFunction;\nexports.IsIterator = IsIterator;\nexports.IsNull = IsNull;\nexports.IsNumber = IsNumber;\nexports.IsObject = IsObject;\nexports.IsRegExp = IsRegExp;\nexports.IsString = IsString;\nexports.IsSymbol = IsSymbol;\nexports.IsUint8Array = IsUint8Array;\nexports.IsUndefined = IsUndefined;\n// --------------------------------------------------------------------------\n// PropertyKey\n// --------------------------------------------------------------------------\n/** Returns true if this value has this property key */\nfunction HasPropertyKey(value, key) {\n  return key in value;\n}\n// --------------------------------------------------------------------------\n// Object Instances\n// --------------------------------------------------------------------------\n/** Returns true if this value is an async iterator */\nfunction IsAsyncIterator(value) {\n  return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.asyncIterator in value;\n}\n/** Returns true if this value is an array */\nfunction IsArray(value) {\n  return Array.isArray(value);\n}\n/** Returns true if this value is bigint */\nfunction IsBigInt(value) {\n  return typeof value === 'bigint';\n}\n/** Returns true if this value is a boolean */\nfunction IsBoolean(value) {\n  return typeof value === 'boolean';\n}\n/** Returns true if this value is a Date object */\nfunction IsDate(value) {\n  return value instanceof globalThis.Date;\n}\n/** Returns true if this value is a function */\nfunction IsFunction(value) {\n  return typeof value === 'function';\n}\n/** Returns true if this value is an iterator */\nfunction IsIterator(value) {\n  return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.iterator in value;\n}\n/** Returns true if this value is null */\nfunction IsNull(value) {\n  return value === null;\n}\n/** Returns true if this value is number */\nfunction IsNumber(value) {\n  return typeof value === 'number';\n}\n/** Returns true if this value is an object */\nfunction IsObject(value) {\n  return _typeof(value) === 'object' && value !== null;\n}\n/** Returns true if this value is RegExp */\nfunction IsRegExp(value) {\n  return value instanceof globalThis.RegExp;\n}\n/** Returns true if this value is string */\nfunction IsString(value) {\n  return typeof value === 'string';\n}\n/** Returns true if this value is symbol */\nfunction IsSymbol(value) {\n  return _typeof(value) === 'symbol';\n}\n/** Returns true if this value is a Uint8Array */\nfunction IsUint8Array(value) {\n  return value instanceof globalThis.Uint8Array;\n}\n/** Returns true if this value is undefined */\nfunction IsUndefined(value) {\n  return value === undefined;\n}\n\n},{}],99:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Increment = Increment;\n/** Increments the given string value + 1 */\nfunction Increment(T) {\n  return (parseInt(T) + 1).toString();\n}\n\n},{}],100:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./helpers\"), exports);\n\n},{\"./helpers\":99}],101:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./indexed-from-mapped-key\"), exports);\n__exportStar(require(\"./indexed-from-mapped-result\"), exports);\n__exportStar(require(\"./indexed-property-keys\"), exports);\n__exportStar(require(\"./indexed\"), exports);\n\n},{\"./indexed\":105,\"./indexed-from-mapped-key\":102,\"./indexed-from-mapped-result\":103,\"./indexed-property-keys\":104}],102:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.IndexFromMappedKey = IndexFromMappedKey;\nvar indexed_1 = require(\"./indexed\");\nvar index_1 = require(\"../mapped/index\");\nvar value_1 = require(\"../clone/value\");\n// prettier-ignore\nfunction MappedIndexPropertyKey(type, key, options) {\n  return _defineProperty({}, key, (0, indexed_1.Index)(type, [key], (0, value_1.Clone)(options)));\n}\n// prettier-ignore\nfunction MappedIndexPropertyKeys(type, propertyKeys, options) {\n  return propertyKeys.reduce(function (result, left) {\n    return _objectSpread(_objectSpread({}, result), MappedIndexPropertyKey(type, left, options));\n  }, {});\n}\n// prettier-ignore\nfunction MappedIndexProperties(type, mappedKey, options) {\n  return MappedIndexPropertyKeys(type, mappedKey.keys, options);\n}\n// prettier-ignore\nfunction IndexFromMappedKey(type, mappedKey, options) {\n  var properties = MappedIndexProperties(type, mappedKey, options);\n  return (0, index_1.MappedResult)(properties);\n}\n\n},{\"../clone/value\":57,\"../mapped/index\":133,\"./indexed\":105}],103:[function(require,module,exports){\n\"use strict\";\n\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.IndexFromMappedResult = IndexFromMappedResult;\nvar index_1 = require(\"../mapped/index\");\nvar indexed_property_keys_1 = require(\"./indexed-property-keys\");\nvar index_2 = require(\"./index\");\n// prettier-ignore\nfunction FromProperties(type, properties, options) {\n  var result = {};\n  var _iterator = _createForOfIteratorHelper(Object.getOwnPropertyNames(properties)),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var K2 = _step.value;\n      result[K2] = (0, index_2.Index)(type, (0, indexed_property_keys_1.IndexPropertyKeys)(properties[K2]), options);\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return result;\n}\n// prettier-ignore\nfunction FromMappedResult(type, mappedResult, options) {\n  return FromProperties(type, mappedResult.properties, options);\n}\n// prettier-ignore\nfunction IndexFromMappedResult(type, mappedResult, options) {\n  var properties = FromMappedResult(type, mappedResult, options);\n  return (0, index_1.MappedResult)(properties);\n}\n\n},{\"../mapped/index\":133,\"./index\":101,\"./indexed-property-keys\":104}],104:[function(require,module,exports){\n\"use strict\";\n\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.IndexPropertyKeys = IndexPropertyKeys;\nvar index_1 = require(\"../template-literal/index\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\n// prettier-ignore\nfunction FromTemplateLiteral(templateLiteral) {\n  var keys = (0, index_1.TemplateLiteralGenerate)(templateLiteral);\n  return keys.map(function (key) {\n    return key.toString();\n  });\n}\n// prettier-ignore\nfunction FromUnion(types) {\n  var result = [];\n  var _iterator = _createForOfIteratorHelper(types),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var type = _step.value;\n      result.push.apply(result, _toConsumableArray(IndexPropertyKeys(type)));\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return result;\n}\n// prettier-ignore\nfunction FromLiteral(literalValue) {\n  return [literalValue.toString()] // TS 5.4 observes TLiteralValue as not having a toString()\n  ;\n}\n/** Returns a tuple of PropertyKeys derived from the given TSchema */\n// prettier-ignore\nfunction IndexPropertyKeys(type) {\n  return _toConsumableArray(new Set((0, kind_1.IsTemplateLiteral)(type) ? FromTemplateLiteral(type) : (0, kind_1.IsUnion)(type) ? FromUnion(type.anyOf) : (0, kind_1.IsLiteral)(type) ? FromLiteral(type[\"const\"]) : (0, kind_1.IsNumber)(type) ? ['[number]'] : (0, kind_1.IsInteger)(type) ? ['[number]'] : []));\n}\n\n},{\"../guard/kind\":96,\"../template-literal/index\":208}],105:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.IndexFromPropertyKey = IndexFromPropertyKey;\nexports.IndexFromPropertyKeys = IndexFromPropertyKeys;\nexports.IndexFromComputed = IndexFromComputed;\nexports.Index = Index;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../error/index\");\nvar index_2 = require(\"../computed/index\");\nvar index_3 = require(\"../never/index\");\nvar index_4 = require(\"../intersect/index\");\nvar index_5 = require(\"../union/index\");\nvar indexed_property_keys_1 = require(\"./indexed-property-keys\");\nvar indexed_from_mapped_key_1 = require(\"./indexed-from-mapped-key\");\nvar indexed_from_mapped_result_1 = require(\"./indexed-from-mapped-result\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\n// prettier-ignore\nfunction FromRest(types, key) {\n  return types.map(function (type) {\n    return IndexFromPropertyKey(type, key);\n  });\n}\n// prettier-ignore\nfunction FromIntersectRest(types) {\n  return types.filter(function (type) {\n    return !(0, kind_1.IsNever)(type);\n  });\n}\n// prettier-ignore\nfunction FromIntersect(types, key) {\n  return (0, index_4.IntersectEvaluated)(FromIntersectRest(FromRest(types, key)));\n}\n// prettier-ignore\nfunction FromUnionRest(types) {\n  return types.some(function (L) {\n    return (0, kind_1.IsNever)(L);\n  }) ? [] : types;\n}\n// prettier-ignore\nfunction FromUnion(types, key) {\n  return (0, index_5.UnionEvaluated)(FromUnionRest(FromRest(types, key)));\n}\n// prettier-ignore\nfunction FromTuple(types, key) {\n  return key in types ? types[key] : key === '[number]' ? (0, index_5.UnionEvaluated)(types) : (0, index_3.Never)();\n}\n// prettier-ignore\nfunction FromArray(type, key) {\n  return key === '[number]' ? type : (0, index_3.Never)();\n}\n// prettier-ignore\nfunction FromProperty(properties, propertyKey) {\n  return propertyKey in properties ? properties[propertyKey] : (0, index_3.Never)();\n}\n// prettier-ignore\nfunction IndexFromPropertyKey(type, propertyKey) {\n  var _type$items;\n  return (0, kind_1.IsIntersect)(type) ? FromIntersect(type.allOf, propertyKey) : (0, kind_1.IsUnion)(type) ? FromUnion(type.anyOf, propertyKey) : (0, kind_1.IsTuple)(type) ? FromTuple((_type$items = type.items) !== null && _type$items !== void 0 ? _type$items : [], propertyKey) : (0, kind_1.IsArray)(type) ? FromArray(type.items, propertyKey) : (0, kind_1.IsObject)(type) ? FromProperty(type.properties, propertyKey) : (0, index_3.Never)();\n}\n// prettier-ignore\nfunction IndexFromPropertyKeys(type, propertyKeys) {\n  return propertyKeys.map(function (propertyKey) {\n    return IndexFromPropertyKey(type, propertyKey);\n  });\n}\n// prettier-ignore\nfunction FromSchema(type, propertyKeys) {\n  return (0, index_5.UnionEvaluated)(IndexFromPropertyKeys(type, propertyKeys));\n}\n// prettier-ignore\nfunction IndexFromComputed(type, key) {\n  return (0, index_2.Computed)('Index', [type, key]);\n}\n/** `[Json]` Returns an Indexed property type for the given keys */\nfunction Index(type, key, options) {\n  // computed-type\n  if ((0, kind_1.IsRef)(type) || (0, kind_1.IsRef)(key)) {\n    var error = \"Index types using Ref parameters require both Type and Key to be of TSchema\";\n    if (!(0, kind_1.IsSchema)(type) || !(0, kind_1.IsSchema)(key)) throw new index_1.TypeBoxError(error);\n    return (0, index_2.Computed)('Index', [type, key]);\n  }\n  // mapped-types\n  if ((0, kind_1.IsMappedResult)(key)) return (0, indexed_from_mapped_result_1.IndexFromMappedResult)(type, key, options);\n  if ((0, kind_1.IsMappedKey)(key)) return (0, indexed_from_mapped_key_1.IndexFromMappedKey)(type, key, options);\n  // prettier-ignore\n  return (0, type_1.CreateType)((0, kind_1.IsSchema)(key) ? FromSchema(type, (0, indexed_property_keys_1.IndexPropertyKeys)(key)) : FromSchema(type, key), options);\n}\n\n},{\"../computed/index\":61,\"../create/type\":70,\"../error/index\":78,\"../guard/kind\":96,\"../intersect/index\":112,\"../never/index\":140,\"../union/index\":226,\"./indexed-from-mapped-key\":102,\"./indexed-from-mapped-result\":103,\"./indexed-property-keys\":104}],106:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./instance-type\"), exports);\n\n},{\"./instance-type\":107}],107:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.InstanceType = InstanceType;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../never/index\");\nvar KindGuard = require(\"../guard/kind\");\n/** `[JavaScript]` Extracts the InstanceType from the given Constructor type */\nfunction InstanceType(schema, options) {\n  return KindGuard.IsConstructor(schema) ? (0, type_1.CreateType)(schema.returns, options) : (0, index_1.Never)(options);\n}\n\n},{\"../create/type\":70,\"../guard/kind\":96,\"../never/index\":140}],108:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./instantiate\"), exports);\n\n},{\"./instantiate\":109}],109:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.FromTypes = FromTypes;\nexports.Instantiate = Instantiate;\nvar type_1 = require(\"../clone/type\");\nvar index_1 = require(\"../unknown/index\");\nvar index_2 = require(\"../readonly-optional/index\");\nvar index_3 = require(\"../readonly/index\");\nvar index_4 = require(\"../optional/index\");\nvar index_5 = require(\"../object/index\");\nvar index_6 = require(\"../record/index\");\nvar ValueGuard = require(\"../guard/value\");\nvar KindGuard = require(\"../guard/kind\");\n// prettier-ignore\nfunction FromConstructor(args, type) {\n  type.parameters = FromTypes(args, type.parameters);\n  type.returns = FromType(args, type.returns);\n  return type;\n}\n// prettier-ignore\nfunction FromFunction(args, type) {\n  type.parameters = FromTypes(args, type.parameters);\n  type.returns = FromType(args, type.returns);\n  return type;\n}\n// prettier-ignore\nfunction FromIntersect(args, type) {\n  type.allOf = FromTypes(args, type.allOf);\n  return type;\n}\n// prettier-ignore\nfunction FromUnion(args, type) {\n  type.anyOf = FromTypes(args, type.anyOf);\n  return type;\n}\n// prettier-ignore\nfunction FromTuple(args, type) {\n  if (ValueGuard.IsUndefined(type.items)) return type;\n  type.items = FromTypes(args, type.items);\n  return type;\n}\n// prettier-ignore\nfunction FromArray(args, type) {\n  type.items = FromType(args, type.items);\n  return type;\n}\n// prettier-ignore\nfunction FromAsyncIterator(args, type) {\n  type.items = FromType(args, type.items);\n  return type;\n}\n// prettier-ignore\nfunction FromIterator(args, type) {\n  type.items = FromType(args, type.items);\n  return type;\n}\n// prettier-ignore\nfunction FromPromise(args, type) {\n  type.item = FromType(args, type.item);\n  return type;\n}\n// prettier-ignore\nfunction FromObject(args, type) {\n  var mappedProperties = FromProperties(args, type.properties);\n  return _objectSpread(_objectSpread({}, type), (0, index_5.Object)(mappedProperties)); // retain options\n}\n// prettier-ignore\nfunction FromRecord(args, type) {\n  var mappedKey = FromType(args, (0, index_6.RecordKey)(type));\n  var mappedValue = FromType(args, (0, index_6.RecordValue)(type));\n  var result = (0, index_6.Record)(mappedKey, mappedValue);\n  return _objectSpread(_objectSpread({}, type), result); // retain options\n}\n// prettier-ignore\nfunction FromArgument(args, argument) {\n  return argument.index in args ? args[argument.index] : (0, index_1.Unknown)();\n}\n// prettier-ignore\nfunction FromProperty(args, type) {\n  var isReadonly = KindGuard.IsReadonly(type);\n  var isOptional = KindGuard.IsOptional(type);\n  var mapped = FromType(args, type);\n  return isReadonly && isOptional ? (0, index_2.ReadonlyOptional)(mapped) : isReadonly && !isOptional ? (0, index_3.Readonly)(mapped) : !isReadonly && isOptional ? (0, index_4.Optional)(mapped) : mapped;\n}\n// prettier-ignore\nfunction FromProperties(args, properties) {\n  return globalThis.Object.getOwnPropertyNames(properties).reduce(function (result, key) {\n    return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, key, FromProperty(args, properties[key])));\n  }, {});\n}\n// prettier-ignore\nfunction FromTypes(args, types) {\n  return types.map(function (type) {\n    return FromType(args, type);\n  });\n}\n// prettier-ignore\nfunction FromType(args, type) {\n  return KindGuard.IsConstructor(type) ? FromConstructor(args, type) : KindGuard.IsFunction(type) ? FromFunction(args, type) : KindGuard.IsIntersect(type) ? FromIntersect(args, type) : KindGuard.IsUnion(type) ? FromUnion(args, type) : KindGuard.IsTuple(type) ? FromTuple(args, type) : KindGuard.IsArray(type) ? FromArray(args, type) : KindGuard.IsAsyncIterator(type) ? FromAsyncIterator(args, type) : KindGuard.IsIterator(type) ? FromIterator(args, type) : KindGuard.IsPromise(type) ? FromPromise(args, type) : KindGuard.IsObject(type) ? FromObject(args, type) : KindGuard.IsRecord(type) ? FromRecord(args, type) : KindGuard.IsArgument(type) ? FromArgument(args, type) : type;\n}\n/** `[JavaScript]` Instantiates a type with the given parameters */\n// prettier-ignore\nfunction Instantiate(type, args) {\n  return FromType(args, (0, type_1.CloneType)(type));\n}\n\n},{\"../clone/type\":56,\"../guard/kind\":96,\"../guard/value\":98,\"../object/index\":148,\"../optional/index\":154,\"../readonly-optional/index\":170,\"../readonly/index\":172,\"../record/index\":175,\"../unknown/index\":231}],110:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./integer\"), exports);\n\n},{\"./integer\":111}],111:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Integer = Integer;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[Json]` Creates an Integer type */\nfunction Integer(options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty({}, index_1.Kind, 'Integer'), \"type\", 'integer'), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],112:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./intersect-evaluated\"), exports);\n__exportStar(require(\"./intersect-type\"), exports);\n__exportStar(require(\"./intersect\"), exports);\n\n},{\"./intersect\":116,\"./intersect-evaluated\":114,\"./intersect-type\":115}],113:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.IntersectCreate = IntersectCreate;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\n// ------------------------------------------------------------------\n// IntersectCreate\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction IntersectCreate(T) {\n  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  var allObjects = T.every(function (schema) {\n    return (0, kind_1.IsObject)(schema);\n  });\n  var clonedUnevaluatedProperties = (0, kind_1.IsSchema)(options.unevaluatedProperties) ? {\n    unevaluatedProperties: options.unevaluatedProperties\n  } : {};\n  return (0, type_1.CreateType)(options.unevaluatedProperties === false || (0, kind_1.IsSchema)(options.unevaluatedProperties) || allObjects ? _objectSpread(_objectSpread({}, clonedUnevaluatedProperties), {}, _defineProperty(_defineProperty(_defineProperty({}, index_1.Kind, 'Intersect'), \"type\", 'object'), \"allOf\", T)) : _objectSpread(_objectSpread({}, clonedUnevaluatedProperties), {}, _defineProperty(_defineProperty({}, index_1.Kind, 'Intersect'), \"allOf\", T)), options);\n}\n\n},{\"../create/type\":70,\"../guard/kind\":96,\"../symbols/index\":204}],114:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.IntersectEvaluated = IntersectEvaluated;\nvar index_1 = require(\"../symbols/index\");\nvar type_1 = require(\"../create/type\");\nvar index_2 = require(\"../discard/index\");\nvar index_3 = require(\"../never/index\");\nvar index_4 = require(\"../optional/index\");\nvar intersect_create_1 = require(\"./intersect-create\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\n// prettier-ignore\nfunction IsIntersectOptional(types) {\n  return types.every(function (left) {\n    return (0, kind_1.IsOptional)(left);\n  });\n}\n// prettier-ignore\nfunction RemoveOptionalFromType(type) {\n  return (0, index_2.Discard)(type, [index_1.OptionalKind]);\n}\n// prettier-ignore\nfunction RemoveOptionalFromRest(types) {\n  return types.map(function (left) {\n    return (0, kind_1.IsOptional)(left) ? RemoveOptionalFromType(left) : left;\n  });\n}\n// prettier-ignore\nfunction ResolveIntersect(types, options) {\n  return IsIntersectOptional(types) ? (0, index_4.Optional)((0, intersect_create_1.IntersectCreate)(RemoveOptionalFromRest(types), options)) : (0, intersect_create_1.IntersectCreate)(RemoveOptionalFromRest(types), options);\n}\n/** `[Json]` Creates an evaluated Intersect type */\nfunction IntersectEvaluated(types) {\n  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  if (types.length === 1) return (0, type_1.CreateType)(types[0], options);\n  if (types.length === 0) return (0, index_3.Never)(options);\n  if (types.some(function (schema) {\n    return (0, kind_1.IsTransform)(schema);\n  })) throw new Error('Cannot intersect transform types');\n  return ResolveIntersect(types, options);\n}\n\n},{\"../create/type\":70,\"../discard/index\":74,\"../guard/kind\":96,\"../never/index\":140,\"../optional/index\":154,\"../symbols/index\":204,\"./intersect-create\":113}],115:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nvar index_1 = require(\"../symbols/index\");\n\n},{\"../symbols/index\":204}],116:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Intersect = Intersect;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../never/index\");\nvar intersect_create_1 = require(\"./intersect-create\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\n/** `[Json]` Creates an evaluated Intersect type */\nfunction Intersect(types, options) {\n  if (types.length === 1) return (0, type_1.CreateType)(types[0], options);\n  if (types.length === 0) return (0, index_1.Never)(options);\n  if (types.some(function (schema) {\n    return (0, kind_1.IsTransform)(schema);\n  })) throw new Error('Cannot intersect transform types');\n  return (0, intersect_create_1.IntersectCreate)(types, options);\n}\n\n},{\"../create/type\":70,\"../guard/kind\":96,\"../never/index\":140,\"./intersect-create\":113}],117:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Capitalize = Capitalize;\nvar intrinsic_1 = require(\"./intrinsic\");\n/** `[Json]` Intrinsic function to Capitalize LiteralString types */\nfunction Capitalize(T) {\n  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  return (0, intrinsic_1.Intrinsic)(T, 'Capitalize', options);\n}\n\n},{\"./intrinsic\":120}],118:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./capitalize\"), exports);\n__exportStar(require(\"./intrinsic-from-mapped-key\"), exports);\n__exportStar(require(\"./intrinsic\"), exports);\n__exportStar(require(\"./lowercase\"), exports);\n__exportStar(require(\"./uncapitalize\"), exports);\n__exportStar(require(\"./uppercase\"), exports);\n\n},{\"./capitalize\":117,\"./intrinsic\":120,\"./intrinsic-from-mapped-key\":119,\"./lowercase\":121,\"./uncapitalize\":122,\"./uppercase\":123}],119:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.IntrinsicFromMappedKey = IntrinsicFromMappedKey;\nvar index_1 = require(\"../mapped/index\");\nvar intrinsic_1 = require(\"./intrinsic\");\nvar index_2 = require(\"../literal/index\");\nvar value_1 = require(\"../clone/value\");\n// prettier-ignore\nfunction MappedIntrinsicPropertyKey(K, M, options) {\n  return _defineProperty({}, K, (0, intrinsic_1.Intrinsic)((0, index_2.Literal)(K), M, (0, value_1.Clone)(options)));\n}\n// prettier-ignore\nfunction MappedIntrinsicPropertyKeys(K, M, options) {\n  var result = K.reduce(function (Acc, L) {\n    return _objectSpread(_objectSpread({}, Acc), MappedIntrinsicPropertyKey(L, M, options));\n  }, {});\n  return result;\n}\n// prettier-ignore\nfunction MappedIntrinsicProperties(T, M, options) {\n  return MappedIntrinsicPropertyKeys(T['keys'], M, options);\n}\n// prettier-ignore\nfunction IntrinsicFromMappedKey(T, M, options) {\n  var P = MappedIntrinsicProperties(T, M, options);\n  return (0, index_1.MappedResult)(P);\n}\n\n},{\"../clone/value\":57,\"../literal/index\":131,\"../mapped/index\":133,\"./intrinsic\":120}],120:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Intrinsic = Intrinsic;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../template-literal/index\");\nvar intrinsic_from_mapped_key_1 = require(\"./intrinsic-from-mapped-key\");\nvar index_2 = require(\"../literal/index\");\nvar index_3 = require(\"../union/index\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\n// ------------------------------------------------------------------\n// Apply\n// ------------------------------------------------------------------\nfunction ApplyUncapitalize(value) {\n  var _ref = [value.slice(0, 1), value.slice(1)],\n    first = _ref[0],\n    rest = _ref[1];\n  return [first.toLowerCase(), rest].join('');\n}\nfunction ApplyCapitalize(value) {\n  var _ref2 = [value.slice(0, 1), value.slice(1)],\n    first = _ref2[0],\n    rest = _ref2[1];\n  return [first.toUpperCase(), rest].join('');\n}\nfunction ApplyUppercase(value) {\n  return value.toUpperCase();\n}\nfunction ApplyLowercase(value) {\n  return value.toLowerCase();\n}\nfunction FromTemplateLiteral(schema, mode, options) {\n  // note: template literals require special runtime handling as they are encoded in string patterns.\n  // This diverges from the mapped type which would otherwise map on the template literal kind.\n  var expression = (0, index_1.TemplateLiteralParseExact)(schema.pattern);\n  var finite = (0, index_1.IsTemplateLiteralExpressionFinite)(expression);\n  if (!finite) return _objectSpread(_objectSpread({}, schema), {}, {\n    pattern: FromLiteralValue(schema.pattern, mode)\n  });\n  var strings = _toConsumableArray((0, index_1.TemplateLiteralExpressionGenerate)(expression));\n  var literals = strings.map(function (value) {\n    return (0, index_2.Literal)(value);\n  });\n  var mapped = FromRest(literals, mode);\n  var union = (0, index_3.Union)(mapped);\n  return (0, index_1.TemplateLiteral)([union], options);\n}\n// prettier-ignore\nfunction FromLiteralValue(value, mode) {\n  return typeof value === 'string' ? mode === 'Uncapitalize' ? ApplyUncapitalize(value) : mode === 'Capitalize' ? ApplyCapitalize(value) : mode === 'Uppercase' ? ApplyUppercase(value) : mode === 'Lowercase' ? ApplyLowercase(value) : value : value.toString();\n}\n// prettier-ignore\nfunction FromRest(T, M) {\n  return T.map(function (L) {\n    return Intrinsic(L, M);\n  });\n}\n/** Applies an intrinsic string manipulation to the given type. */\nfunction Intrinsic(schema, mode) {\n  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n  // prettier-ignore\n  return (\n    // Intrinsic-Mapped-Inference\n    (0, kind_1.IsMappedKey)(schema) ? (0, intrinsic_from_mapped_key_1.IntrinsicFromMappedKey)(schema, mode, options) :\n    // Standard-Inference\n    (0, kind_1.IsTemplateLiteral)(schema) ? FromTemplateLiteral(schema, mode, options) : (0, kind_1.IsUnion)(schema) ? (0, index_3.Union)(FromRest(schema.anyOf, mode), options) : (0, kind_1.IsLiteral)(schema) ? (0, index_2.Literal)(FromLiteralValue(schema[\"const\"], mode), options) :\n    // Default Type\n    (0, type_1.CreateType)(schema, options)\n  );\n}\n\n},{\"../create/type\":70,\"../guard/kind\":96,\"../literal/index\":131,\"../template-literal/index\":208,\"../union/index\":226,\"./intrinsic-from-mapped-key\":119}],121:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Lowercase = Lowercase;\nvar intrinsic_1 = require(\"./intrinsic\");\n/** `[Json]` Intrinsic function to Lowercase LiteralString types */\nfunction Lowercase(T) {\n  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  return (0, intrinsic_1.Intrinsic)(T, 'Lowercase', options);\n}\n\n},{\"./intrinsic\":120}],122:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Uncapitalize = Uncapitalize;\nvar intrinsic_1 = require(\"./intrinsic\");\n/** `[Json]` Intrinsic function to Uncapitalize LiteralString types */\nfunction Uncapitalize(T) {\n  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  return (0, intrinsic_1.Intrinsic)(T, 'Uncapitalize', options);\n}\n\n},{\"./intrinsic\":120}],123:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Uppercase = Uppercase;\nvar intrinsic_1 = require(\"./intrinsic\");\n/** `[Json]` Intrinsic function to Uppercase LiteralString types */\nfunction Uppercase(T) {\n  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  return (0, intrinsic_1.Intrinsic)(T, 'Uppercase', options);\n}\n\n},{\"./intrinsic\":120}],124:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./iterator\"), exports);\n\n},{\"./iterator\":125}],125:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Iterator = Iterator;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[JavaScript]` Creates an Iterator type */\nfunction Iterator(items, options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty(_defineProperty({}, index_1.Kind, 'Iterator'), \"type\", 'Iterator'), \"items\", items), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],126:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./keyof-from-mapped-result\"), exports);\n__exportStar(require(\"./keyof-property-entries\"), exports);\n__exportStar(require(\"./keyof-property-keys\"), exports);\n__exportStar(require(\"./keyof\"), exports);\n\n},{\"./keyof\":130,\"./keyof-from-mapped-result\":127,\"./keyof-property-entries\":128,\"./keyof-property-keys\":129}],127:[function(require,module,exports){\n\"use strict\";\n\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.KeyOfFromMappedResult = KeyOfFromMappedResult;\nvar index_1 = require(\"../mapped/index\");\nvar keyof_1 = require(\"./keyof\");\nvar value_1 = require(\"../clone/value\");\n// prettier-ignore\nfunction FromProperties(properties, options) {\n  var result = {};\n  var _iterator = _createForOfIteratorHelper(globalThis.Object.getOwnPropertyNames(properties)),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var K2 = _step.value;\n      result[K2] = (0, keyof_1.KeyOf)(properties[K2], (0, value_1.Clone)(options));\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return result;\n}\n// prettier-ignore\nfunction FromMappedResult(mappedResult, options) {\n  return FromProperties(mappedResult.properties, options);\n}\n// prettier-ignore\nfunction KeyOfFromMappedResult(mappedResult, options) {\n  var properties = FromMappedResult(mappedResult, options);\n  return (0, index_1.MappedResult)(properties);\n}\n\n},{\"../clone/value\":57,\"../mapped/index\":133,\"./keyof\":130}],128:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.KeyOfPropertyEntries = KeyOfPropertyEntries;\nvar indexed_1 = require(\"../indexed/indexed\");\nvar keyof_property_keys_1 = require(\"./keyof-property-keys\");\n/**\n * `[Utility]` Resolves an array of keys and schemas from the given schema. This method is faster\n * than obtaining the keys and resolving each individually via indexing. This method was written\n * accellerate Intersect and Union encoding.\n */\nfunction KeyOfPropertyEntries(schema) {\n  var keys = (0, keyof_property_keys_1.KeyOfPropertyKeys)(schema);\n  var schemas = (0, indexed_1.IndexFromPropertyKeys)(schema, keys);\n  return keys.map(function (_, index) {\n    return [keys[index], schemas[index]];\n  });\n}\n\n},{\"../indexed/indexed\":105,\"./keyof-property-keys\":129}],129:[function(require,module,exports){\n\"use strict\";\n\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.KeyOfPropertyKeys = KeyOfPropertyKeys;\nexports.KeyOfPattern = KeyOfPattern;\nvar index_1 = require(\"../sets/index\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\n// prettier-ignore\nfunction FromRest(types) {\n  var result = [];\n  var _iterator = _createForOfIteratorHelper(types),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var L = _step.value;\n      result.push(KeyOfPropertyKeys(L));\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return result;\n}\n// prettier-ignore\nfunction FromIntersect(types) {\n  var propertyKeysArray = FromRest(types);\n  var propertyKeys = (0, index_1.SetUnionMany)(propertyKeysArray);\n  return propertyKeys;\n}\n// prettier-ignore\nfunction FromUnion(types) {\n  var propertyKeysArray = FromRest(types);\n  var propertyKeys = (0, index_1.SetIntersectMany)(propertyKeysArray);\n  return propertyKeys;\n}\n// prettier-ignore\nfunction FromTuple(types) {\n  return types.map(function (_, indexer) {\n    return indexer.toString();\n  });\n}\n// prettier-ignore\nfunction FromArray(_) {\n  return ['[number]'];\n}\n// prettier-ignore\nfunction FromProperties(T) {\n  return globalThis.Object.getOwnPropertyNames(T);\n}\n// ------------------------------------------------------------------\n// FromPatternProperties\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromPatternProperties(patternProperties) {\n  if (!includePatternProperties) return [];\n  var patternPropertyKeys = globalThis.Object.getOwnPropertyNames(patternProperties);\n  return patternPropertyKeys.map(function (key) {\n    return key[0] === '^' && key[key.length - 1] === '$' ? key.slice(1, key.length - 1) : key;\n  });\n}\n/** Returns a tuple of PropertyKeys derived from the given TSchema. */\n// prettier-ignore\nfunction KeyOfPropertyKeys(type) {\n  var _type$items;\n  return (0, kind_1.IsIntersect)(type) ? FromIntersect(type.allOf) : (0, kind_1.IsUnion)(type) ? FromUnion(type.anyOf) : (0, kind_1.IsTuple)(type) ? FromTuple((_type$items = type.items) !== null && _type$items !== void 0 ? _type$items : []) : (0, kind_1.IsArray)(type) ? FromArray(type.items) : (0, kind_1.IsObject)(type) ? FromProperties(type.properties) : (0, kind_1.IsRecord)(type) ? FromPatternProperties(type.patternProperties) : [];\n}\n// ----------------------------------------------------------------\n// KeyOfPattern\n// ----------------------------------------------------------------\nvar includePatternProperties = false;\n/** Returns a regular expression pattern derived from the given TSchema */\nfunction KeyOfPattern(schema) {\n  includePatternProperties = true;\n  var keys = KeyOfPropertyKeys(schema);\n  includePatternProperties = false;\n  var pattern = keys.map(function (key) {\n    return \"(\".concat(key, \")\");\n  });\n  return \"^(\".concat(pattern.join('|'), \")$\");\n}\n\n},{\"../guard/kind\":96,\"../sets/index\":196}],130:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.KeyOfPropertyKeysToRest = KeyOfPropertyKeysToRest;\nexports.KeyOf = KeyOf;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../literal/index\");\nvar index_2 = require(\"../number/index\");\nvar index_3 = require(\"../computed/index\");\nvar index_4 = require(\"../ref/index\");\nvar keyof_property_keys_1 = require(\"./keyof-property-keys\");\nvar index_5 = require(\"../union/index\");\nvar keyof_from_mapped_result_1 = require(\"./keyof-from-mapped-result\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\n// prettier-ignore\nfunction FromComputed(target, parameters) {\n  return (0, index_3.Computed)('KeyOf', [(0, index_3.Computed)(target, parameters)]);\n}\n// prettier-ignore\nfunction FromRef($ref) {\n  return (0, index_3.Computed)('KeyOf', [(0, index_4.Ref)($ref)]);\n}\n// prettier-ignore\nfunction KeyOfFromType(type, options) {\n  var propertyKeys = (0, keyof_property_keys_1.KeyOfPropertyKeys)(type);\n  var propertyKeyTypes = KeyOfPropertyKeysToRest(propertyKeys);\n  var result = (0, index_5.UnionEvaluated)(propertyKeyTypes);\n  return (0, type_1.CreateType)(result, options);\n}\n// prettier-ignore\nfunction KeyOfPropertyKeysToRest(propertyKeys) {\n  return propertyKeys.map(function (L) {\n    return L === '[number]' ? (0, index_2.Number)() : (0, index_1.Literal)(L);\n  });\n}\n/** `[Json]` Creates a KeyOf type */\nfunction KeyOf(type, options) {\n  return (0, kind_1.IsComputed)(type) ? FromComputed(type.target, type.parameters) : (0, kind_1.IsRef)(type) ? FromRef(type.$ref) : (0, kind_1.IsMappedResult)(type) ? (0, keyof_from_mapped_result_1.KeyOfFromMappedResult)(type, options) : KeyOfFromType(type, options);\n}\n\n},{\"../computed/index\":61,\"../create/type\":70,\"../guard/kind\":96,\"../literal/index\":131,\"../number/index\":146,\"../ref/index\":179,\"../union/index\":226,\"./keyof-from-mapped-result\":127,\"./keyof-property-keys\":129}],131:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./literal\"), exports);\n\n},{\"./literal\":132}],132:[function(require,module,exports){\n\"use strict\";\n\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Literal = Literal;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[Json]` Creates a Literal type */\nfunction Literal(value, options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty(_defineProperty({}, index_1.Kind, 'Literal'), \"const\", value), \"type\", _typeof(value)), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],133:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./mapped-key\"), exports);\n__exportStar(require(\"./mapped-result\"), exports);\n__exportStar(require(\"./mapped\"), exports);\n\n},{\"./mapped\":136,\"./mapped-key\":134,\"./mapped-result\":135}],134:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.MappedKey = MappedKey;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n// prettier-ignore\nfunction MappedKey(T) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty({}, index_1.Kind, 'MappedKey'), \"keys\", T));\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],135:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.MappedResult = MappedResult;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n// prettier-ignore\nfunction MappedResult(properties) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty({}, index_1.Kind, 'MappedResult'), \"properties\", properties));\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],136:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.MappedFunctionReturnType = MappedFunctionReturnType;\nexports.Mapped = Mapped;\nvar index_1 = require(\"../symbols/index\");\nvar index_2 = require(\"../discard/index\");\n// evaluation types\nvar index_3 = require(\"../array/index\");\nvar index_4 = require(\"../async-iterator/index\");\nvar index_5 = require(\"../constructor/index\");\nvar index_6 = require(\"../function/index\");\nvar index_7 = require(\"../indexed/index\");\nvar index_8 = require(\"../intersect/index\");\nvar index_9 = require(\"../iterator/index\");\nvar index_10 = require(\"../literal/index\");\nvar index_11 = require(\"../object/index\");\nvar index_12 = require(\"../optional/index\");\nvar index_13 = require(\"../promise/index\");\nvar index_14 = require(\"../readonly/index\");\nvar index_15 = require(\"../tuple/index\");\nvar index_16 = require(\"../union/index\");\n// operator\nvar index_17 = require(\"../sets/index\");\n// mapping types\nvar mapped_result_1 = require(\"./mapped-result\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\n// prettier-ignore\nfunction FromMappedResult(K, P) {\n  return K in P ? FromSchemaType(K, P[K]) : (0, mapped_result_1.MappedResult)(P);\n}\n// prettier-ignore\nfunction MappedKeyToKnownMappedResultProperties(K) {\n  return _defineProperty({}, K, (0, index_10.Literal)(K));\n}\n// prettier-ignore\nfunction MappedKeyToUnknownMappedResultProperties(P) {\n  var Acc = {};\n  var _iterator = _createForOfIteratorHelper(P),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var L = _step.value;\n      Acc[L] = (0, index_10.Literal)(L);\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return Acc;\n}\n// prettier-ignore\nfunction MappedKeyToMappedResultProperties(K, P) {\n  return (0, index_17.SetIncludes)(P, K) ? MappedKeyToKnownMappedResultProperties(K) : MappedKeyToUnknownMappedResultProperties(P);\n}\n// prettier-ignore\nfunction FromMappedKey(K, P) {\n  var R = MappedKeyToMappedResultProperties(K, P);\n  return FromMappedResult(K, R);\n}\n// prettier-ignore\nfunction FromRest(K, T) {\n  return T.map(function (L) {\n    return FromSchemaType(K, L);\n  });\n}\n// prettier-ignore\nfunction FromProperties(K, T) {\n  var Acc = {};\n  var _iterator2 = _createForOfIteratorHelper(globalThis.Object.getOwnPropertyNames(T)),\n    _step2;\n  try {\n    for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n      var K2 = _step2.value;\n      Acc[K2] = FromSchemaType(K, T[K2]);\n    }\n  } catch (err) {\n    _iterator2.e(err);\n  } finally {\n    _iterator2.f();\n  }\n  return Acc;\n}\n// prettier-ignore\nfunction FromSchemaType(K, T) {\n  var _T$items;\n  // required to retain user defined options for mapped type\n  var options = _objectSpread({}, T);\n  return (\n    // unevaluated modifier types\n    (0, kind_1.IsOptional)(T) ? (0, index_12.Optional)(FromSchemaType(K, (0, index_2.Discard)(T, [index_1.OptionalKind]))) : (0, kind_1.IsReadonly)(T) ? (0, index_14.Readonly)(FromSchemaType(K, (0, index_2.Discard)(T, [index_1.ReadonlyKind]))) :\n    // unevaluated mapped types\n    (0, kind_1.IsMappedResult)(T) ? FromMappedResult(K, T.properties) : (0, kind_1.IsMappedKey)(T) ? FromMappedKey(K, T.keys) :\n    // unevaluated types\n    (0, kind_1.IsConstructor)(T) ? (0, index_5.Constructor)(FromRest(K, T.parameters), FromSchemaType(K, T.returns), options) : (0, kind_1.IsFunction)(T) ? (0, index_6.Function)(FromRest(K, T.parameters), FromSchemaType(K, T.returns), options) : (0, kind_1.IsAsyncIterator)(T) ? (0, index_4.AsyncIterator)(FromSchemaType(K, T.items), options) : (0, kind_1.IsIterator)(T) ? (0, index_9.Iterator)(FromSchemaType(K, T.items), options) : (0, kind_1.IsIntersect)(T) ? (0, index_8.Intersect)(FromRest(K, T.allOf), options) : (0, kind_1.IsUnion)(T) ? (0, index_16.Union)(FromRest(K, T.anyOf), options) : (0, kind_1.IsTuple)(T) ? (0, index_15.Tuple)(FromRest(K, (_T$items = T.items) !== null && _T$items !== void 0 ? _T$items : []), options) : (0, kind_1.IsObject)(T) ? (0, index_11.Object)(FromProperties(K, T.properties), options) : (0, kind_1.IsArray)(T) ? (0, index_3.Array)(FromSchemaType(K, T.items), options) : (0, kind_1.IsPromise)(T) ? (0, index_13.Promise)(FromSchemaType(K, T.item), options) : T\n  );\n}\n// prettier-ignore\nfunction MappedFunctionReturnType(K, T) {\n  var Acc = {};\n  var _iterator3 = _createForOfIteratorHelper(K),\n    _step3;\n  try {\n    for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n      var L = _step3.value;\n      Acc[L] = FromSchemaType(L, T);\n    }\n  } catch (err) {\n    _iterator3.e(err);\n  } finally {\n    _iterator3.f();\n  }\n  return Acc;\n}\n/** `[Json]` Creates a Mapped object type */\nfunction Mapped(key, map, options) {\n  var K = (0, kind_1.IsSchema)(key) ? (0, index_7.IndexPropertyKeys)(key) : key;\n  var RT = map(_defineProperty(_defineProperty({}, index_1.Kind, 'MappedKey'), \"keys\", K));\n  var R = MappedFunctionReturnType(K, RT);\n  return (0, index_11.Object)(R, options);\n}\n\n},{\"../array/index\":46,\"../async-iterator/index\":48,\"../constructor/index\":67,\"../discard/index\":74,\"../function/index\":94,\"../guard/kind\":96,\"../indexed/index\":101,\"../intersect/index\":112,\"../iterator/index\":124,\"../literal/index\":131,\"../object/index\":148,\"../optional/index\":154,\"../promise/index\":168,\"../readonly/index\":172,\"../sets/index\":196,\"../symbols/index\":204,\"../tuple/index\":216,\"../union/index\":226,\"./mapped-result\":135}],137:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.FromType = FromType;\nexports.ComputeType = ComputeType;\nexports.ComputeModuleProperties = ComputeModuleProperties;\nvar index_1 = require(\"../create/index\");\nvar index_2 = require(\"../clone/index\");\nvar index_3 = require(\"../discard/index\");\nvar index_4 = require(\"../array/index\");\nvar index_5 = require(\"../awaited/index\");\nvar index_6 = require(\"../async-iterator/index\");\nvar index_7 = require(\"../constructor/index\");\nvar index_8 = require(\"../indexed/index\");\nvar index_9 = require(\"../function/index\");\nvar index_10 = require(\"../intersect/index\");\nvar index_11 = require(\"../iterator/index\");\nvar index_12 = require(\"../keyof/index\");\nvar index_13 = require(\"../object/index\");\nvar index_14 = require(\"../omit/index\");\nvar index_15 = require(\"../pick/index\");\nvar index_16 = require(\"../never/index\");\nvar index_17 = require(\"../partial/index\");\nvar index_18 = require(\"../record/index\");\nvar index_19 = require(\"../required/index\");\nvar index_20 = require(\"../tuple/index\");\nvar index_21 = require(\"../union/index\");\n// ------------------------------------------------------------------\n// Symbols\n// ------------------------------------------------------------------\nvar index_22 = require(\"../symbols/index\");\n// ------------------------------------------------------------------\n// KindGuard\n// ------------------------------------------------------------------\nvar KindGuard = require(\"../guard/kind\");\n// prettier-ignore\nfunction DereferenceParameters(moduleProperties, types) {\n  return types.map(function (type) {\n    return KindGuard.IsRef(type) ? Dereference(moduleProperties, type.$ref) : FromType(moduleProperties, type);\n  });\n}\n// prettier-ignore\nfunction Dereference(moduleProperties, ref) {\n  return ref in moduleProperties ? KindGuard.IsRef(moduleProperties[ref]) ? Dereference(moduleProperties, moduleProperties[ref].$ref) : FromType(moduleProperties, moduleProperties[ref]) : (0, index_16.Never)();\n}\n// prettier-ignore\nfunction FromAwaited(parameters) {\n  return (0, index_5.Awaited)(parameters[0]);\n}\n// prettier-ignore\nfunction FromIndex(parameters) {\n  return (0, index_8.Index)(parameters[0], parameters[1]);\n}\n// prettier-ignore\nfunction FromKeyOf(parameters) {\n  return (0, index_12.KeyOf)(parameters[0]);\n}\n// prettier-ignore\nfunction FromPartial(parameters) {\n  return (0, index_17.Partial)(parameters[0]);\n}\n// prettier-ignore\nfunction FromOmit(parameters) {\n  return (0, index_14.Omit)(parameters[0], parameters[1]);\n}\n// prettier-ignore\nfunction FromPick(parameters) {\n  return (0, index_15.Pick)(parameters[0], parameters[1]);\n}\n// prettier-ignore\nfunction FromRequired(parameters) {\n  return (0, index_19.Required)(parameters[0]);\n}\n// prettier-ignore\nfunction FromComputed(moduleProperties, target, parameters) {\n  var dereferenced = DereferenceParameters(moduleProperties, parameters);\n  return target === 'Awaited' ? FromAwaited(dereferenced) : target === 'Index' ? FromIndex(dereferenced) : target === 'KeyOf' ? FromKeyOf(dereferenced) : target === 'Partial' ? FromPartial(dereferenced) : target === 'Omit' ? FromOmit(dereferenced) : target === 'Pick' ? FromPick(dereferenced) : target === 'Required' ? FromRequired(dereferenced) : (0, index_16.Never)();\n}\nfunction FromArray(moduleProperties, type) {\n  return (0, index_4.Array)(FromType(moduleProperties, type));\n}\nfunction FromAsyncIterator(moduleProperties, type) {\n  return (0, index_6.AsyncIterator)(FromType(moduleProperties, type));\n}\n// prettier-ignore\nfunction FromConstructor(moduleProperties, parameters, instanceType) {\n  return (0, index_7.Constructor)(FromTypes(moduleProperties, parameters), FromType(moduleProperties, instanceType));\n}\n// prettier-ignore\nfunction FromFunction(moduleProperties, parameters, returnType) {\n  return (0, index_9.Function)(FromTypes(moduleProperties, parameters), FromType(moduleProperties, returnType));\n}\nfunction FromIntersect(moduleProperties, types) {\n  return (0, index_10.Intersect)(FromTypes(moduleProperties, types));\n}\nfunction FromIterator(moduleProperties, type) {\n  return (0, index_11.Iterator)(FromType(moduleProperties, type));\n}\nfunction FromObject(moduleProperties, properties) {\n  return (0, index_13.Object)(globalThis.Object.keys(properties).reduce(function (result, key) {\n    return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, key, FromType(moduleProperties, properties[key])));\n  }, {}));\n}\n// prettier-ignore\nfunction FromRecord(moduleProperties, type) {\n  var _ref = [FromType(moduleProperties, (0, index_18.RecordValue)(type)), (0, index_18.RecordPattern)(type)],\n    value = _ref[0],\n    pattern = _ref[1];\n  var result = (0, index_2.CloneType)(type);\n  result.patternProperties[pattern] = value;\n  return result;\n}\n// prettier-ignore\nfunction FromTransform(moduleProperties, transform) {\n  return KindGuard.IsRef(transform) ? _objectSpread(_objectSpread({}, Dereference(moduleProperties, transform.$ref)), {}, _defineProperty({}, index_22.TransformKind, transform[index_22.TransformKind])) : transform;\n}\nfunction FromTuple(moduleProperties, types) {\n  return (0, index_20.Tuple)(FromTypes(moduleProperties, types));\n}\nfunction FromUnion(moduleProperties, types) {\n  return (0, index_21.Union)(FromTypes(moduleProperties, types));\n}\nfunction FromTypes(moduleProperties, types) {\n  return types.map(function (type) {\n    return FromType(moduleProperties, type);\n  });\n}\n// prettier-ignore\nfunction FromType(moduleProperties, type) {\n  return (\n    // Modifiers\n    KindGuard.IsOptional(type) ? (0, index_1.CreateType)(FromType(moduleProperties, (0, index_3.Discard)(type, [index_22.OptionalKind])), type) : KindGuard.IsReadonly(type) ? (0, index_1.CreateType)(FromType(moduleProperties, (0, index_3.Discard)(type, [index_22.ReadonlyKind])), type) :\n    // Transform\n    KindGuard.IsTransform(type) ? (0, index_1.CreateType)(FromTransform(moduleProperties, type), type) :\n    // Types\n    KindGuard.IsArray(type) ? (0, index_1.CreateType)(FromArray(moduleProperties, type.items), type) : KindGuard.IsAsyncIterator(type) ? (0, index_1.CreateType)(FromAsyncIterator(moduleProperties, type.items), type) : KindGuard.IsComputed(type) ? (0, index_1.CreateType)(FromComputed(moduleProperties, type.target, type.parameters)) : KindGuard.IsConstructor(type) ? (0, index_1.CreateType)(FromConstructor(moduleProperties, type.parameters, type.returns), type) : KindGuard.IsFunction(type) ? (0, index_1.CreateType)(FromFunction(moduleProperties, type.parameters, type.returns), type) : KindGuard.IsIntersect(type) ? (0, index_1.CreateType)(FromIntersect(moduleProperties, type.allOf), type) : KindGuard.IsIterator(type) ? (0, index_1.CreateType)(FromIterator(moduleProperties, type.items), type) : KindGuard.IsObject(type) ? (0, index_1.CreateType)(FromObject(moduleProperties, type.properties), type) : KindGuard.IsRecord(type) ? (0, index_1.CreateType)(FromRecord(moduleProperties, type)) : KindGuard.IsTuple(type) ? (0, index_1.CreateType)(FromTuple(moduleProperties, type.items || []), type) : KindGuard.IsUnion(type) ? (0, index_1.CreateType)(FromUnion(moduleProperties, type.anyOf), type) : type\n  );\n}\n// prettier-ignore\nfunction ComputeType(moduleProperties, key) {\n  return key in moduleProperties ? FromType(moduleProperties, moduleProperties[key]) : (0, index_16.Never)();\n}\n// prettier-ignore\nfunction ComputeModuleProperties(moduleProperties) {\n  return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce(function (result, key) {\n    return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, key, ComputeType(moduleProperties, key)));\n  }, {});\n}\n\n},{\"../array/index\":46,\"../async-iterator/index\":48,\"../awaited/index\":50,\"../clone/index\":55,\"../constructor/index\":67,\"../create/index\":69,\"../discard/index\":74,\"../function/index\":94,\"../guard/kind\":96,\"../indexed/index\":101,\"../intersect/index\":112,\"../iterator/index\":124,\"../keyof/index\":126,\"../never/index\":140,\"../object/index\":148,\"../omit/index\":150,\"../partial/index\":159,\"../pick/index\":164,\"../record/index\":175,\"../required/index\":186,\"../symbols/index\":204,\"../tuple/index\":216,\"../union/index\":226}],138:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./module\"), exports);\n\n},{\"./module\":139}],139:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TModule = void 0;\nexports.Module = Module;\nvar index_1 = require(\"../create/index\");\nvar index_2 = require(\"../symbols/index\");\n// ------------------------------------------------------------------\n// Module Infrastructure Types\n// ------------------------------------------------------------------\nvar compute_1 = require(\"./compute\");\n// ------------------------------------------------------------------\n// Module\n// ------------------------------------------------------------------\n// prettier-ignore\nvar TModule = /*#__PURE__*/function () {\n  function TModule($defs) {\n    _classCallCheck(this, TModule);\n    var computed = (0, compute_1.ComputeModuleProperties)($defs);\n    var identified = this.WithIdentifiers(computed);\n    this.$defs = identified;\n  }\n  /** `[Json]` Imports a Type by Key. */\n  return _createClass(TModule, [{\n    key: \"Import\",\n    value: function Import(key, options) {\n      var $defs = _objectSpread(_objectSpread({}, this.$defs), {}, _defineProperty({}, key, (0, index_1.CreateType)(this.$defs[key], options)));\n      return (0, index_1.CreateType)(_defineProperty(_defineProperty(_defineProperty({}, index_2.Kind, 'Import'), \"$defs\", $defs), \"$ref\", key));\n    }\n    // prettier-ignore\n  }, {\n    key: \"WithIdentifiers\",\n    value: function WithIdentifiers($defs) {\n      return globalThis.Object.getOwnPropertyNames($defs).reduce(function (result, key) {\n        return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, key, _objectSpread(_objectSpread({}, $defs[key]), {}, {\n          $id: key\n        })));\n      }, {});\n    }\n  }]);\n}();\nexports.TModule = TModule;\n/** `[Json]` Creates a Type Definition Module. */\nfunction Module(properties) {\n  return new TModule(properties);\n}\n\n},{\"../create/index\":69,\"../symbols/index\":204,\"./compute\":137}],140:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./never\"), exports);\n\n},{\"./never\":141}],141:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Never = Never;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[Json]` Creates a Never type */\nfunction Never(options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty({}, index_1.Kind, 'Never'), \"not\", {}), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],142:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./not\"), exports);\n\n},{\"./not\":143}],143:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Not = Not;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[Json]` Creates a Not type */\nfunction Not(type, options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty({}, index_1.Kind, 'Not'), \"not\", type), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],144:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./null\"), exports);\n\n},{\"./null\":145}],145:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Null = Null;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[Json]` Creates a Null type */\nfunction Null(options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty({}, index_1.Kind, 'Null'), \"type\", 'null'), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],146:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./number\"), exports);\n\n},{\"./number\":147}],147:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Number = _Number;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[Json]` Creates a Number type */\nfunction _Number(options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty({}, index_1.Kind, 'Number'), \"type\", 'number'), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],148:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./object\"), exports);\n\n},{\"./object\":149}],149:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Object = void 0;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\nfunction RequiredKeys(properties) {\n  var keys = [];\n  for (var key in properties) {\n    if (!(0, kind_1.IsOptional)(properties[key])) keys.push(key);\n  }\n  return keys;\n}\n/** `[Json]` Creates an Object type */\nfunction _Object(properties, options) {\n  var required = RequiredKeys(properties);\n  var schematic = required.length > 0 ? _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, index_1.Kind, 'Object'), \"type\", 'object'), \"properties\", properties), \"required\", required) : _defineProperty(_defineProperty(_defineProperty({}, index_1.Kind, 'Object'), \"type\", 'object'), \"properties\", properties);\n  return (0, type_1.CreateType)(schematic, options);\n}\n/** `[Json]` Creates an Object type */\nexports.Object = _Object;\n\n},{\"../create/type\":70,\"../guard/kind\":96,\"../symbols/index\":204}],150:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./omit-from-mapped-key\"), exports);\n__exportStar(require(\"./omit-from-mapped-result\"), exports);\n__exportStar(require(\"./omit\"), exports);\n\n},{\"./omit\":153,\"./omit-from-mapped-key\":151,\"./omit-from-mapped-result\":152}],151:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.OmitFromMappedKey = OmitFromMappedKey;\nvar index_1 = require(\"../mapped/index\");\nvar omit_1 = require(\"./omit\");\nvar value_1 = require(\"../clone/value\");\n// prettier-ignore\nfunction FromPropertyKey(type, key, options) {\n  return _defineProperty({}, key, (0, omit_1.Omit)(type, [key], (0, value_1.Clone)(options)));\n}\n// prettier-ignore\nfunction FromPropertyKeys(type, propertyKeys, options) {\n  return propertyKeys.reduce(function (Acc, LK) {\n    return _objectSpread(_objectSpread({}, Acc), FromPropertyKey(type, LK, options));\n  }, {});\n}\n// prettier-ignore\nfunction FromMappedKey(type, mappedKey, options) {\n  return FromPropertyKeys(type, mappedKey.keys, options);\n}\n// prettier-ignore\nfunction OmitFromMappedKey(type, mappedKey, options) {\n  var properties = FromMappedKey(type, mappedKey, options);\n  return (0, index_1.MappedResult)(properties);\n}\n\n},{\"../clone/value\":57,\"../mapped/index\":133,\"./omit\":153}],152:[function(require,module,exports){\n\"use strict\";\n\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.OmitFromMappedResult = OmitFromMappedResult;\nvar index_1 = require(\"../mapped/index\");\nvar omit_1 = require(\"./omit\");\nvar value_1 = require(\"../clone/value\");\n// prettier-ignore\nfunction FromProperties(properties, propertyKeys, options) {\n  var result = {};\n  var _iterator = _createForOfIteratorHelper(globalThis.Object.getOwnPropertyNames(properties)),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var K2 = _step.value;\n      result[K2] = (0, omit_1.Omit)(properties[K2], propertyKeys, (0, value_1.Clone)(options));\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return result;\n}\n// prettier-ignore\nfunction FromMappedResult(mappedResult, propertyKeys, options) {\n  return FromProperties(mappedResult.properties, propertyKeys, options);\n}\n// prettier-ignore\nfunction OmitFromMappedResult(mappedResult, propertyKeys, options) {\n  var properties = FromMappedResult(mappedResult, propertyKeys, options);\n  return (0, index_1.MappedResult)(properties);\n}\n\n},{\"../clone/value\":57,\"../mapped/index\":133,\"./omit\":153}],153:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }\nfunction _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Omit = Omit;\nvar type_1 = require(\"../create/type\");\nvar discard_1 = require(\"../discard/discard\");\nvar symbols_1 = require(\"../symbols/symbols\");\nvar index_1 = require(\"../computed/index\");\nvar index_2 = require(\"../literal/index\");\nvar index_3 = require(\"../indexed/index\");\nvar index_4 = require(\"../intersect/index\");\nvar index_5 = require(\"../union/index\");\nvar index_6 = require(\"../object/index\");\n// ------------------------------------------------------------------\n// Mapped\n// ------------------------------------------------------------------\nvar omit_from_mapped_key_1 = require(\"./omit-from-mapped-key\");\nvar omit_from_mapped_result_1 = require(\"./omit-from-mapped-result\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\nvar value_1 = require(\"../guard/value\");\n// prettier-ignore\nfunction FromIntersect(types, propertyKeys) {\n  return types.map(function (type) {\n    return OmitResolve(type, propertyKeys);\n  });\n}\n// prettier-ignore\nfunction FromUnion(types, propertyKeys) {\n  return types.map(function (type) {\n    return OmitResolve(type, propertyKeys);\n  });\n}\n// ------------------------------------------------------------------\n// FromProperty\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromProperty(properties, key) {\n  var _ = properties[key],\n    R = _objectWithoutProperties(properties, [key].map(_toPropertyKey));\n  return R;\n}\n// prettier-ignore\nfunction FromProperties(properties, propertyKeys) {\n  return propertyKeys.reduce(function (T, K2) {\n    return FromProperty(T, K2);\n  }, properties);\n}\n// prettier-ignore\nfunction FromObject(properties, propertyKeys) {\n  var options = (0, discard_1.Discard)(properties, [symbols_1.TransformKind, '$id', 'required', 'properties']);\n  var omittedProperties = FromProperties(properties['properties'], propertyKeys);\n  return (0, index_6.Object)(omittedProperties, options);\n}\n// prettier-ignore\nfunction UnionFromPropertyKeys(propertyKeys) {\n  var result = propertyKeys.reduce(function (result, key) {\n    return (0, kind_1.IsLiteralValue)(key) ? [].concat(_toConsumableArray(result), [(0, index_2.Literal)(key)]) : result;\n  }, []);\n  return (0, index_5.Union)(result);\n}\n// prettier-ignore\nfunction OmitResolve(properties, propertyKeys) {\n  return (0, kind_1.IsIntersect)(properties) ? (0, index_4.Intersect)(FromIntersect(properties.allOf, propertyKeys)) : (0, kind_1.IsUnion)(properties) ? (0, index_5.Union)(FromUnion(properties.anyOf, propertyKeys)) : (0, kind_1.IsObject)(properties) ? FromObject(properties, propertyKeys) : (0, index_6.Object)({});\n}\n/** `[Json]` Constructs a type whose keys are picked from the given type */\n// prettier-ignore\nfunction Omit(type, key, options) {\n  var typeKey = (0, value_1.IsArray)(key) ? UnionFromPropertyKeys(key) : key;\n  var propertyKeys = (0, kind_1.IsSchema)(key) ? (0, index_3.IndexPropertyKeys)(key) : key;\n  var isTypeRef = (0, kind_1.IsRef)(type);\n  var isKeyRef = (0, kind_1.IsRef)(key);\n  return (0, kind_1.IsMappedResult)(type) ? (0, omit_from_mapped_result_1.OmitFromMappedResult)(type, propertyKeys, options) : (0, kind_1.IsMappedKey)(key) ? (0, omit_from_mapped_key_1.OmitFromMappedKey)(type, key, options) : isTypeRef && isKeyRef ? (0, index_1.Computed)('Omit', [type, typeKey], options) : !isTypeRef && isKeyRef ? (0, index_1.Computed)('Omit', [type, typeKey], options) : isTypeRef && !isKeyRef ? (0, index_1.Computed)('Omit', [type, typeKey], options) : (0, type_1.CreateType)(_objectSpread(_objectSpread({}, OmitResolve(type, propertyKeys)), options));\n}\n\n},{\"../computed/index\":61,\"../create/type\":70,\"../discard/discard\":73,\"../guard/kind\":96,\"../guard/value\":98,\"../indexed/index\":101,\"../intersect/index\":112,\"../literal/index\":131,\"../object/index\":148,\"../symbols/symbols\":205,\"../union/index\":226,\"./omit-from-mapped-key\":151,\"./omit-from-mapped-result\":152}],154:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./optional-from-mapped-result\"), exports);\n__exportStar(require(\"./optional\"), exports);\n\n},{\"./optional\":156,\"./optional-from-mapped-result\":155}],155:[function(require,module,exports){\n\"use strict\";\n\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.OptionalFromMappedResult = OptionalFromMappedResult;\nvar index_1 = require(\"../mapped/index\");\nvar optional_1 = require(\"./optional\");\n// prettier-ignore\nfunction FromProperties(P, F) {\n  var Acc = {};\n  var _iterator = _createForOfIteratorHelper(globalThis.Object.getOwnPropertyNames(P)),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var K2 = _step.value;\n      Acc[K2] = (0, optional_1.Optional)(P[K2], F);\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return Acc;\n}\n// prettier-ignore\nfunction FromMappedResult(R, F) {\n  return FromProperties(R.properties, F);\n}\n// prettier-ignore\nfunction OptionalFromMappedResult(R, F) {\n  var P = FromMappedResult(R, F);\n  return (0, index_1.MappedResult)(P);\n}\n\n},{\"../mapped/index\":133,\"./optional\":156}],156:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Optional = Optional;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\nvar index_2 = require(\"../discard/index\");\nvar optional_from_mapped_result_1 = require(\"./optional-from-mapped-result\");\nvar kind_1 = require(\"../guard/kind\");\nfunction RemoveOptional(schema) {\n  return (0, type_1.CreateType)((0, index_2.Discard)(schema, [index_1.OptionalKind]));\n}\nfunction AddOptional(schema) {\n  return (0, type_1.CreateType)(_objectSpread(_objectSpread({}, schema), {}, _defineProperty({}, index_1.OptionalKind, 'Optional')));\n}\n// prettier-ignore\nfunction OptionalWithFlag(schema, F) {\n  return F === false ? RemoveOptional(schema) : AddOptional(schema);\n}\n/** `[Json]` Creates a Optional property */\nfunction Optional(schema, enable) {\n  var F = enable !== null && enable !== void 0 ? enable : true;\n  return (0, kind_1.IsMappedResult)(schema) ? (0, optional_from_mapped_result_1.OptionalFromMappedResult)(schema, F) : OptionalWithFlag(schema, F);\n}\n\n},{\"../create/type\":70,\"../discard/index\":74,\"../guard/kind\":96,\"../symbols/index\":204,\"./optional-from-mapped-result\":155}],157:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./parameters\"), exports);\n\n},{\"./parameters\":158}],158:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Parameters = Parameters;\nvar index_1 = require(\"../tuple/index\");\nvar index_2 = require(\"../never/index\");\nvar KindGuard = require(\"../guard/kind\");\n/** `[JavaScript]` Extracts the Parameters from the given Function type */\nfunction Parameters(schema, options) {\n  return KindGuard.IsFunction(schema) ? (0, index_1.Tuple)(schema.parameters, options) : (0, index_2.Never)();\n}\n\n},{\"../guard/kind\":96,\"../never/index\":140,\"../tuple/index\":216}],159:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./partial-from-mapped-result\"), exports);\n__exportStar(require(\"./partial\"), exports);\n\n},{\"./partial\":161,\"./partial-from-mapped-result\":160}],160:[function(require,module,exports){\n\"use strict\";\n\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.PartialFromMappedResult = PartialFromMappedResult;\nvar index_1 = require(\"../mapped/index\");\nvar partial_1 = require(\"./partial\");\nvar value_1 = require(\"../clone/value\");\n// prettier-ignore\nfunction FromProperties(K, options) {\n  var Acc = {};\n  var _iterator = _createForOfIteratorHelper(globalThis.Object.getOwnPropertyNames(K)),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var K2 = _step.value;\n      Acc[K2] = (0, partial_1.Partial)(K[K2], (0, value_1.Clone)(options));\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return Acc;\n}\n// prettier-ignore\nfunction FromMappedResult(R, options) {\n  return FromProperties(R.properties, options);\n}\n// prettier-ignore\nfunction PartialFromMappedResult(R, options) {\n  var P = FromMappedResult(R, options);\n  return (0, index_1.MappedResult)(P);\n}\n\n},{\"../clone/value\":57,\"../mapped/index\":133,\"./partial\":161}],161:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Partial = Partial;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../computed/index\");\nvar index_2 = require(\"../optional/index\");\nvar index_3 = require(\"../object/index\");\nvar index_4 = require(\"../intersect/index\");\nvar index_5 = require(\"../union/index\");\nvar index_6 = require(\"../ref/index\");\nvar index_7 = require(\"../discard/index\");\nvar index_8 = require(\"../symbols/index\");\nvar partial_from_mapped_result_1 = require(\"./partial-from-mapped-result\");\n// ------------------------------------------------------------------\n// KindGuard\n// ------------------------------------------------------------------\nvar KindGuard = require(\"../guard/kind\");\n// prettier-ignore\nfunction FromComputed(target, parameters) {\n  return (0, index_1.Computed)('Partial', [(0, index_1.Computed)(target, parameters)]);\n}\n// prettier-ignore\nfunction FromRef($ref) {\n  return (0, index_1.Computed)('Partial', [(0, index_6.Ref)($ref)]);\n}\n// prettier-ignore\nfunction FromProperties(properties) {\n  var partialProperties = {};\n  var _iterator = _createForOfIteratorHelper(globalThis.Object.getOwnPropertyNames(properties)),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var K = _step.value;\n      partialProperties[K] = (0, index_2.Optional)(properties[K]);\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return partialProperties;\n}\n// prettier-ignore\nfunction FromObject(type) {\n  var options = (0, index_7.Discard)(type, [index_8.TransformKind, '$id', 'required', 'properties']);\n  var properties = FromProperties(type['properties']);\n  return (0, index_3.Object)(properties, options);\n}\n// prettier-ignore\nfunction FromRest(types) {\n  return types.map(function (type) {\n    return PartialResolve(type);\n  });\n}\n// ------------------------------------------------------------------\n// PartialResolve\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction PartialResolve(type) {\n  return (\n    // Mappable\n    KindGuard.IsComputed(type) ? FromComputed(type.target, type.parameters) : KindGuard.IsRef(type) ? FromRef(type.$ref) : KindGuard.IsIntersect(type) ? (0, index_4.Intersect)(FromRest(type.allOf)) : KindGuard.IsUnion(type) ? (0, index_5.Union)(FromRest(type.anyOf)) : KindGuard.IsObject(type) ? FromObject(type) :\n    // Intrinsic\n    KindGuard.IsBigInt(type) ? type : KindGuard.IsBoolean(type) ? type : KindGuard.IsInteger(type) ? type : KindGuard.IsLiteral(type) ? type : KindGuard.IsNull(type) ? type : KindGuard.IsNumber(type) ? type : KindGuard.IsString(type) ? type : KindGuard.IsSymbol(type) ? type : KindGuard.IsUndefined(type) ? type :\n    // Passthrough\n    (0, index_3.Object)({})\n  );\n}\n/** `[Json]` Constructs a type where all properties are optional */\nfunction Partial(type, options) {\n  if (KindGuard.IsMappedResult(type)) {\n    return (0, partial_from_mapped_result_1.PartialFromMappedResult)(type, options);\n  } else {\n    // special: mapping types require overridable options\n    return (0, type_1.CreateType)(_objectSpread(_objectSpread({}, PartialResolve(type)), options));\n  }\n}\n\n},{\"../computed/index\":61,\"../create/type\":70,\"../discard/index\":74,\"../guard/kind\":96,\"../intersect/index\":112,\"../object/index\":148,\"../optional/index\":154,\"../ref/index\":179,\"../symbols/index\":204,\"../union/index\":226,\"./partial-from-mapped-result\":160}],162:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./patterns\"), exports);\n\n},{\"./patterns\":163}],163:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.PatternNeverExact = exports.PatternStringExact = exports.PatternNumberExact = exports.PatternBooleanExact = exports.PatternNever = exports.PatternString = exports.PatternNumber = exports.PatternBoolean = void 0;\nexports.PatternBoolean = '(true|false)';\nexports.PatternNumber = '(0|[1-9][0-9]*)';\nexports.PatternString = '(.*)';\nexports.PatternNever = '(?!.*)';\nexports.PatternBooleanExact = \"^\".concat(exports.PatternBoolean, \"$\");\nexports.PatternNumberExact = \"^\".concat(exports.PatternNumber, \"$\");\nexports.PatternStringExact = \"^\".concat(exports.PatternString, \"$\");\nexports.PatternNeverExact = \"^\".concat(exports.PatternNever, \"$\");\n\n},{}],164:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./pick-from-mapped-key\"), exports);\n__exportStar(require(\"./pick-from-mapped-result\"), exports);\n__exportStar(require(\"./pick\"), exports);\n\n},{\"./pick\":167,\"./pick-from-mapped-key\":165,\"./pick-from-mapped-result\":166}],165:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.PickFromMappedKey = PickFromMappedKey;\nvar index_1 = require(\"../mapped/index\");\nvar pick_1 = require(\"./pick\");\nvar value_1 = require(\"../clone/value\");\n// prettier-ignore\nfunction FromPropertyKey(type, key, options) {\n  return _defineProperty({}, key, (0, pick_1.Pick)(type, [key], (0, value_1.Clone)(options)));\n}\n// prettier-ignore\nfunction FromPropertyKeys(type, propertyKeys, options) {\n  return propertyKeys.reduce(function (result, leftKey) {\n    return _objectSpread(_objectSpread({}, result), FromPropertyKey(type, leftKey, options));\n  }, {});\n}\n// prettier-ignore\nfunction FromMappedKey(type, mappedKey, options) {\n  return FromPropertyKeys(type, mappedKey.keys, options);\n}\n// prettier-ignore\nfunction PickFromMappedKey(type, mappedKey, options) {\n  var properties = FromMappedKey(type, mappedKey, options);\n  return (0, index_1.MappedResult)(properties);\n}\n\n},{\"../clone/value\":57,\"../mapped/index\":133,\"./pick\":167}],166:[function(require,module,exports){\n\"use strict\";\n\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.PickFromMappedResult = PickFromMappedResult;\nvar index_1 = require(\"../mapped/index\");\nvar pick_1 = require(\"./pick\");\nvar value_1 = require(\"../clone/value\");\n// prettier-ignore\nfunction FromProperties(properties, propertyKeys, options) {\n  var result = {};\n  var _iterator = _createForOfIteratorHelper(globalThis.Object.getOwnPropertyNames(properties)),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var K2 = _step.value;\n      result[K2] = (0, pick_1.Pick)(properties[K2], propertyKeys, (0, value_1.Clone)(options));\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return result;\n}\n// prettier-ignore\nfunction FromMappedResult(mappedResult, propertyKeys, options) {\n  return FromProperties(mappedResult.properties, propertyKeys, options);\n}\n// prettier-ignore\nfunction PickFromMappedResult(mappedResult, propertyKeys, options) {\n  var properties = FromMappedResult(mappedResult, propertyKeys, options);\n  return (0, index_1.MappedResult)(properties);\n}\n\n},{\"../clone/value\":57,\"../mapped/index\":133,\"./pick\":167}],167:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Pick = Pick;\nvar type_1 = require(\"../create/type\");\nvar discard_1 = require(\"../discard/discard\");\nvar index_1 = require(\"../computed/index\");\nvar index_2 = require(\"../intersect/index\");\nvar index_3 = require(\"../literal/index\");\nvar index_4 = require(\"../object/index\");\nvar index_5 = require(\"../union/index\");\nvar index_6 = require(\"../indexed/index\");\nvar symbols_1 = require(\"../symbols/symbols\");\n// ------------------------------------------------------------------\n// Guards\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\nvar value_1 = require(\"../guard/value\");\n// ------------------------------------------------------------------\n// Infrastructure\n// ------------------------------------------------------------------\nvar pick_from_mapped_key_1 = require(\"./pick-from-mapped-key\");\nvar pick_from_mapped_result_1 = require(\"./pick-from-mapped-result\");\nfunction FromIntersect(types, propertyKeys) {\n  return types.map(function (type) {\n    return PickResolve(type, propertyKeys);\n  });\n}\n// prettier-ignore\nfunction FromUnion(types, propertyKeys) {\n  return types.map(function (type) {\n    return PickResolve(type, propertyKeys);\n  });\n}\n// prettier-ignore\nfunction FromProperties(properties, propertyKeys) {\n  var result = {};\n  var _iterator = _createForOfIteratorHelper(propertyKeys),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var K2 = _step.value;\n      if (K2 in properties) result[K2] = properties[K2];\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return result;\n}\n// prettier-ignore\nfunction FromObject(T, K) {\n  var options = (0, discard_1.Discard)(T, [symbols_1.TransformKind, '$id', 'required', 'properties']);\n  var properties = FromProperties(T['properties'], K);\n  return (0, index_4.Object)(properties, options);\n}\n// prettier-ignore\nfunction UnionFromPropertyKeys(propertyKeys) {\n  var result = propertyKeys.reduce(function (result, key) {\n    return (0, kind_1.IsLiteralValue)(key) ? [].concat(_toConsumableArray(result), [(0, index_3.Literal)(key)]) : result;\n  }, []);\n  return (0, index_5.Union)(result);\n}\n// prettier-ignore\nfunction PickResolve(properties, propertyKeys) {\n  return (0, kind_1.IsIntersect)(properties) ? (0, index_2.Intersect)(FromIntersect(properties.allOf, propertyKeys)) : (0, kind_1.IsUnion)(properties) ? (0, index_5.Union)(FromUnion(properties.anyOf, propertyKeys)) : (0, kind_1.IsObject)(properties) ? FromObject(properties, propertyKeys) : (0, index_4.Object)({});\n}\n/** `[Json]` Constructs a type whose keys are picked from the given type */\n// prettier-ignore\nfunction Pick(type, key, options) {\n  var typeKey = (0, value_1.IsArray)(key) ? UnionFromPropertyKeys(key) : key;\n  var propertyKeys = (0, kind_1.IsSchema)(key) ? (0, index_6.IndexPropertyKeys)(key) : key;\n  var isTypeRef = (0, kind_1.IsRef)(type);\n  var isKeyRef = (0, kind_1.IsRef)(key);\n  return (0, kind_1.IsMappedResult)(type) ? (0, pick_from_mapped_result_1.PickFromMappedResult)(type, propertyKeys, options) : (0, kind_1.IsMappedKey)(key) ? (0, pick_from_mapped_key_1.PickFromMappedKey)(type, key, options) : isTypeRef && isKeyRef ? (0, index_1.Computed)('Pick', [type, typeKey], options) : !isTypeRef && isKeyRef ? (0, index_1.Computed)('Pick', [type, typeKey], options) : isTypeRef && !isKeyRef ? (0, index_1.Computed)('Pick', [type, typeKey], options) : (0, type_1.CreateType)(_objectSpread(_objectSpread({}, PickResolve(type, propertyKeys)), options));\n}\n\n},{\"../computed/index\":61,\"../create/type\":70,\"../discard/discard\":73,\"../guard/kind\":96,\"../guard/value\":98,\"../indexed/index\":101,\"../intersect/index\":112,\"../literal/index\":131,\"../object/index\":148,\"../symbols/symbols\":205,\"../union/index\":226,\"./pick-from-mapped-key\":165,\"./pick-from-mapped-result\":166}],168:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./promise\"), exports);\n\n},{\"./promise\":169}],169:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Promise = Promise;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[JavaScript]` Creates a Promise type */\nfunction Promise(item, options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty(_defineProperty({}, index_1.Kind, 'Promise'), \"type\", 'Promise'), \"item\", item), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],170:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./readonly-optional\"), exports);\n\n},{\"./readonly-optional\":171}],171:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ReadonlyOptional = ReadonlyOptional;\nvar index_1 = require(\"../readonly/index\");\nvar index_2 = require(\"../optional/index\");\n/** `[Json]` Creates a Readonly and Optional property */\nfunction ReadonlyOptional(schema) {\n  return (0, index_1.Readonly)((0, index_2.Optional)(schema));\n}\n\n},{\"../optional/index\":154,\"../readonly/index\":172}],172:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./readonly-from-mapped-result\"), exports);\n__exportStar(require(\"./readonly\"), exports);\n\n},{\"./readonly\":174,\"./readonly-from-mapped-result\":173}],173:[function(require,module,exports){\n\"use strict\";\n\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ReadonlyFromMappedResult = ReadonlyFromMappedResult;\nvar index_1 = require(\"../mapped/index\");\nvar readonly_1 = require(\"./readonly\");\n// prettier-ignore\nfunction FromProperties(K, F) {\n  var Acc = {};\n  var _iterator = _createForOfIteratorHelper(globalThis.Object.getOwnPropertyNames(K)),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var K2 = _step.value;\n      Acc[K2] = (0, readonly_1.Readonly)(K[K2], F);\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return Acc;\n}\n// prettier-ignore\nfunction FromMappedResult(R, F) {\n  return FromProperties(R.properties, F);\n}\n// prettier-ignore\nfunction ReadonlyFromMappedResult(R, F) {\n  var P = FromMappedResult(R, F);\n  return (0, index_1.MappedResult)(P);\n}\n\n},{\"../mapped/index\":133,\"./readonly\":174}],174:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Readonly = Readonly;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\nvar index_2 = require(\"../discard/index\");\nvar readonly_from_mapped_result_1 = require(\"./readonly-from-mapped-result\");\nvar kind_1 = require(\"../guard/kind\");\nfunction RemoveReadonly(schema) {\n  return (0, type_1.CreateType)((0, index_2.Discard)(schema, [index_1.ReadonlyKind]));\n}\nfunction AddReadonly(schema) {\n  return (0, type_1.CreateType)(_objectSpread(_objectSpread({}, schema), {}, _defineProperty({}, index_1.ReadonlyKind, 'Readonly')));\n}\n// prettier-ignore\nfunction ReadonlyWithFlag(schema, F) {\n  return F === false ? RemoveReadonly(schema) : AddReadonly(schema);\n}\n/** `[Json]` Creates a Readonly property */\nfunction Readonly(schema, enable) {\n  var F = enable !== null && enable !== void 0 ? enable : true;\n  return (0, kind_1.IsMappedResult)(schema) ? (0, readonly_from_mapped_result_1.ReadonlyFromMappedResult)(schema, F) : ReadonlyWithFlag(schema, F);\n}\n\n},{\"../create/type\":70,\"../discard/index\":74,\"../guard/kind\":96,\"../symbols/index\":204,\"./readonly-from-mapped-result\":173}],175:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./record\"), exports);\n\n},{\"./record\":176}],176:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Record = Record;\nexports.RecordPattern = RecordPattern;\nexports.RecordKey = RecordKey;\nexports.RecordValue = RecordValue;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\nvar index_2 = require(\"../never/index\");\nvar index_3 = require(\"../number/index\");\nvar index_4 = require(\"../object/index\");\nvar index_5 = require(\"../string/index\");\nvar index_6 = require(\"../union/index\");\nvar index_7 = require(\"../template-literal/index\");\nvar index_8 = require(\"../patterns/index\");\nvar index_9 = require(\"../indexed/index\");\n// ------------------------------------------------------------------\n// ValueGuard\n// ------------------------------------------------------------------\nvar value_1 = require(\"../guard/value\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\n// ------------------------------------------------------------------\n// RecordCreateFromPattern\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction RecordCreateFromPattern(pattern, T, options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty(_defineProperty({}, index_1.Kind, 'Record'), \"type\", 'object'), \"patternProperties\", _defineProperty({}, pattern, T)), options);\n}\n// ------------------------------------------------------------------\n// RecordCreateFromKeys\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction RecordCreateFromKeys(K, T, options) {\n  var result = {};\n  var _iterator = _createForOfIteratorHelper(K),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var K2 = _step.value;\n      result[K2] = T;\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return (0, index_4.Object)(result, _objectSpread(_objectSpread({}, options), {}, _defineProperty({}, index_1.Hint, 'Record')));\n}\n// prettier-ignore\nfunction FromTemplateLiteralKey(K, T, options) {\n  return (0, index_7.IsTemplateLiteralFinite)(K) ? RecordCreateFromKeys((0, index_9.IndexPropertyKeys)(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);\n}\n// prettier-ignore\nfunction FromUnionKey(key, type, options) {\n  return RecordCreateFromKeys((0, index_9.IndexPropertyKeys)((0, index_6.Union)(key)), type, options);\n}\n// prettier-ignore\nfunction FromLiteralKey(key, type, options) {\n  return RecordCreateFromKeys([key.toString()], type, options);\n}\n// prettier-ignore\nfunction FromRegExpKey(key, type, options) {\n  return RecordCreateFromPattern(key.source, type, options);\n}\n// prettier-ignore\nfunction FromStringKey(key, type, options) {\n  var pattern = (0, value_1.IsUndefined)(key.pattern) ? index_8.PatternStringExact : key.pattern;\n  return RecordCreateFromPattern(pattern, type, options);\n}\n// prettier-ignore\nfunction FromAnyKey(_, type, options) {\n  return RecordCreateFromPattern(index_8.PatternStringExact, type, options);\n}\n// prettier-ignore\nfunction FromNeverKey(_key, type, options) {\n  return RecordCreateFromPattern(index_8.PatternNeverExact, type, options);\n}\n// prettier-ignore\nfunction FromBooleanKey(_key, type, options) {\n  return (0, index_4.Object)({\n    \"true\": type,\n    \"false\": type\n  }, options);\n}\n// prettier-ignore\nfunction FromIntegerKey(_key, type, options) {\n  return RecordCreateFromPattern(index_8.PatternNumberExact, type, options);\n}\n// prettier-ignore\nfunction FromNumberKey(_, type, options) {\n  return RecordCreateFromPattern(index_8.PatternNumberExact, type, options);\n}\n// ------------------------------------------------------------------\n// TRecordOrObject\n// ------------------------------------------------------------------\n/** `[Json]` Creates a Record type */\nfunction Record(key, type) {\n  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n  // prettier-ignore\n  return (0, kind_1.IsUnion)(key) ? FromUnionKey(key.anyOf, type, options) : (0, kind_1.IsTemplateLiteral)(key) ? FromTemplateLiteralKey(key, type, options) : (0, kind_1.IsLiteral)(key) ? FromLiteralKey(key[\"const\"], type, options) : (0, kind_1.IsBoolean)(key) ? FromBooleanKey(key, type, options) : (0, kind_1.IsInteger)(key) ? FromIntegerKey(key, type, options) : (0, kind_1.IsNumber)(key) ? FromNumberKey(key, type, options) : (0, kind_1.IsRegExp)(key) ? FromRegExpKey(key, type, options) : (0, kind_1.IsString)(key) ? FromStringKey(key, type, options) : (0, kind_1.IsAny)(key) ? FromAnyKey(key, type, options) : (0, kind_1.IsNever)(key) ? FromNeverKey(key, type, options) : (0, index_2.Never)(options);\n}\n// ------------------------------------------------------------------\n// Record Utilities\n// ------------------------------------------------------------------\n/** Gets the Records Pattern */\nfunction RecordPattern(record) {\n  return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];\n}\n/** Gets the Records Key Type */\n// prettier-ignore\nfunction RecordKey(type) {\n  var pattern = RecordPattern(type);\n  return pattern === index_8.PatternStringExact ? (0, index_5.String)() : pattern === index_8.PatternNumberExact ? (0, index_3.Number)() : (0, index_5.String)({\n    pattern: pattern\n  });\n}\n/** Gets a Record Value Type */\n// prettier-ignore\nfunction RecordValue(type) {\n  return type.patternProperties[RecordPattern(type)];\n}\n\n},{\"../create/type\":70,\"../guard/kind\":96,\"../guard/value\":98,\"../indexed/index\":101,\"../never/index\":140,\"../number/index\":146,\"../object/index\":148,\"../patterns/index\":162,\"../string/index\":200,\"../symbols/index\":204,\"../template-literal/index\":208,\"../union/index\":226}],177:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./recursive\"), exports);\n\n},{\"./recursive\":178}],178:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Recursive = Recursive;\nvar type_1 = require(\"../clone/type\");\nvar type_2 = require(\"../create/type\");\nvar value_1 = require(\"../guard/value\");\nvar index_1 = require(\"../symbols/index\");\n// Auto Tracked For Recursive Types without ID's\nvar Ordinal = 0;\n/** `[Json]` Creates a Recursive type */\nfunction Recursive(callback) {\n  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  if ((0, value_1.IsUndefined)(options.$id)) options.$id = \"T\".concat(Ordinal++);\n  var thisType = (0, type_1.CloneType)(callback(_defineProperty(_defineProperty({}, index_1.Kind, 'This'), \"$ref\", \"\".concat(options.$id))));\n  thisType.$id = options.$id;\n  // prettier-ignore\n  return (0, type_2.CreateType)(_objectSpread(_defineProperty({}, index_1.Hint, 'Recursive'), thisType), options);\n}\n\n},{\"../clone/type\":56,\"../create/type\":70,\"../guard/value\":98,\"../symbols/index\":204}],179:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./ref\"), exports);\n\n},{\"./ref\":180}],180:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Ref = Ref;\nvar index_1 = require(\"../error/index\");\nvar type_1 = require(\"../create/type\");\nvar index_2 = require(\"../symbols/index\");\n/** `[Json]` Creates a Ref type. The referenced type must contain a $id */\nfunction Ref() {\n  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n    args[_key] = arguments[_key];\n  }\n  var _ref = typeof args[0] === 'string' ? [args[0], args[1]] : [args[0].$id, args[1]],\n    _ref2 = _slicedToArray(_ref, 2),\n    $ref = _ref2[0],\n    options = _ref2[1];\n  if (typeof $ref !== 'string') throw new index_1.TypeBoxError('Ref: $ref must be a string');\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty({}, index_2.Kind, 'Ref'), \"$ref\", $ref), options);\n}\n\n},{\"../create/type\":70,\"../error/index\":78,\"../symbols/index\":204}],181:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./regexp\"), exports);\n\n},{\"./regexp\":182}],182:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.RegExp = RegExp;\nvar type_1 = require(\"../create/type\");\nvar value_1 = require(\"../guard/value\");\nvar index_1 = require(\"../symbols/index\");\n/** `[JavaScript]` Creates a RegExp type */\nfunction RegExp(unresolved, options) {\n  var expr = (0, value_1.IsString)(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, index_1.Kind, 'RegExp'), \"type\", 'RegExp'), \"source\", expr.source), \"flags\", expr.flags), options);\n}\n\n},{\"../create/type\":70,\"../guard/value\":98,\"../symbols/index\":204}],183:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Entries = Entries;\nexports.Clear = Clear;\nexports.Delete = Delete;\nexports.Has = Has;\nexports.Set = Set;\nexports.Get = Get;\n/** A registry for user defined string formats */\nvar map = new Map();\n/** Returns the entries in this registry */\nfunction Entries() {\n  return new Map(map);\n}\n/** Clears all user defined string formats */\nfunction Clear() {\n  return map.clear();\n}\n/** Deletes a registered format */\nfunction Delete(format) {\n  return map[\"delete\"](format);\n}\n/** Returns true if the user defined string format exists */\nfunction Has(format) {\n  return map.has(format);\n}\n/** Sets a validation function for a user defined string format */\nfunction Set(format, func) {\n  map.set(format, func);\n}\n/** Gets a validation function for a user defined string format */\nfunction Get(format) {\n  return map.get(format);\n}\n\n},{}],184:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TypeRegistry = exports.FormatRegistry = void 0;\nexports.FormatRegistry = require(\"./format\");\nexports.TypeRegistry = require(\"./type\");\n\n},{\"./format\":183,\"./type\":185}],185:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Entries = Entries;\nexports.Clear = Clear;\nexports.Delete = Delete;\nexports.Has = Has;\nexports.Set = Set;\nexports.Get = Get;\n/** A registry for user defined types */\nvar map = new Map();\n/** Returns the entries in this registry */\nfunction Entries() {\n  return new Map(map);\n}\n/** Clears all user defined types */\nfunction Clear() {\n  return map.clear();\n}\n/** Deletes a registered type */\nfunction Delete(kind) {\n  return map[\"delete\"](kind);\n}\n/** Returns true if this registry contains this kind */\nfunction Has(kind) {\n  return map.has(kind);\n}\n/** Sets a validation function for a user defined type */\nfunction Set(kind, func) {\n  map.set(kind, func);\n}\n/** Gets a custom validation function for a user defined type */\nfunction Get(kind) {\n  return map.get(kind);\n}\n\n},{}],186:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./required-from-mapped-result\"), exports);\n__exportStar(require(\"./required\"), exports);\n\n},{\"./required\":188,\"./required-from-mapped-result\":187}],187:[function(require,module,exports){\n\"use strict\";\n\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.RequiredFromMappedResult = RequiredFromMappedResult;\nvar index_1 = require(\"../mapped/index\");\nvar required_1 = require(\"./required\");\n// prettier-ignore\nfunction FromProperties(P, options) {\n  var Acc = {};\n  var _iterator = _createForOfIteratorHelper(globalThis.Object.getOwnPropertyNames(P)),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var K2 = _step.value;\n      Acc[K2] = (0, required_1.Required)(P[K2], options);\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return Acc;\n}\n// prettier-ignore\nfunction FromMappedResult(R, options) {\n  return FromProperties(R.properties, options);\n}\n// prettier-ignore\nfunction RequiredFromMappedResult(R, options) {\n  var P = FromMappedResult(R, options);\n  return (0, index_1.MappedResult)(P);\n}\n\n},{\"../mapped/index\":133,\"./required\":188}],188:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Required = Required;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../computed/index\");\nvar index_2 = require(\"../object/index\");\nvar index_3 = require(\"../intersect/index\");\nvar index_4 = require(\"../union/index\");\nvar index_5 = require(\"../ref/index\");\nvar index_6 = require(\"../symbols/index\");\nvar index_7 = require(\"../discard/index\");\nvar required_from_mapped_result_1 = require(\"./required-from-mapped-result\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar KindGuard = require(\"../guard/kind\");\n// prettier-ignore\nfunction FromComputed(target, parameters) {\n  return (0, index_1.Computed)('Required', [(0, index_1.Computed)(target, parameters)]);\n}\n// prettier-ignore\nfunction FromRef($ref) {\n  return (0, index_1.Computed)('Required', [(0, index_5.Ref)($ref)]);\n}\n// prettier-ignore\nfunction FromProperties(properties) {\n  var requiredProperties = {};\n  var _iterator = _createForOfIteratorHelper(globalThis.Object.getOwnPropertyNames(properties)),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var K = _step.value;\n      requiredProperties[K] = (0, index_7.Discard)(properties[K], [index_6.OptionalKind]);\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return requiredProperties;\n}\n// prettier-ignore\nfunction FromObject(type) {\n  var options = (0, index_7.Discard)(type, [index_6.TransformKind, '$id', 'required', 'properties']);\n  var properties = FromProperties(type['properties']);\n  return (0, index_2.Object)(properties, options);\n}\n// prettier-ignore\nfunction FromRest(types) {\n  return types.map(function (type) {\n    return RequiredResolve(type);\n  });\n}\n// ------------------------------------------------------------------\n// RequiredResolve\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction RequiredResolve(type) {\n  return (\n    // Mappable\n    KindGuard.IsComputed(type) ? FromComputed(type.target, type.parameters) : KindGuard.IsRef(type) ? FromRef(type.$ref) : KindGuard.IsIntersect(type) ? (0, index_3.Intersect)(FromRest(type.allOf)) : KindGuard.IsUnion(type) ? (0, index_4.Union)(FromRest(type.anyOf)) : KindGuard.IsObject(type) ? FromObject(type) :\n    // Intrinsic\n    KindGuard.IsBigInt(type) ? type : KindGuard.IsBoolean(type) ? type : KindGuard.IsInteger(type) ? type : KindGuard.IsLiteral(type) ? type : KindGuard.IsNull(type) ? type : KindGuard.IsNumber(type) ? type : KindGuard.IsString(type) ? type : KindGuard.IsSymbol(type) ? type : KindGuard.IsUndefined(type) ? type :\n    // Passthrough\n    (0, index_2.Object)({})\n  );\n}\n/** `[Json]` Constructs a type where all properties are required */\nfunction Required(type, options) {\n  if (KindGuard.IsMappedResult(type)) {\n    return (0, required_from_mapped_result_1.RequiredFromMappedResult)(type, options);\n  } else {\n    // special: mapping types require overridable options\n    return (0, type_1.CreateType)(_objectSpread(_objectSpread({}, RequiredResolve(type)), options));\n  }\n}\n\n},{\"../computed/index\":61,\"../create/type\":70,\"../discard/index\":74,\"../guard/kind\":96,\"../intersect/index\":112,\"../object/index\":148,\"../ref/index\":179,\"../symbols/index\":204,\"../union/index\":226,\"./required-from-mapped-result\":187}],189:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./rest\"), exports);\n\n},{\"./rest\":190}],190:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Rest = Rest;\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\n// prettier-ignore\nfunction RestResolve(T) {\n  var _T$items;\n  return (0, kind_1.IsIntersect)(T) ? T.allOf : (0, kind_1.IsUnion)(T) ? T.anyOf : (0, kind_1.IsTuple)(T) ? (_T$items = T.items) !== null && _T$items !== void 0 ? _T$items : [] : [];\n}\n/** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */\nfunction Rest(T) {\n  return RestResolve(T);\n}\n\n},{\"../guard/kind\":96}],191:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./return-type\"), exports);\n\n},{\"./return-type\":192}],192:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ReturnType = ReturnType;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../never/index\");\nvar KindGuard = require(\"../guard/kind\");\n/** `[JavaScript]` Extracts the ReturnType from the given Function type */\nfunction ReturnType(schema, options) {\n  return KindGuard.IsFunction(schema) ? (0, type_1.CreateType)(schema.returns, options) : (0, index_1.Never)(options);\n}\n\n},{\"../create/type\":70,\"../guard/kind\":96,\"../never/index\":140}],193:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\n},{}],194:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./anyschema\"), exports);\n__exportStar(require(\"./schema\"), exports);\n\n},{\"./anyschema\":193,\"./schema\":195}],195:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nvar index_1 = require(\"../symbols/index\");\n\n},{\"../symbols/index\":204}],196:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./set\"), exports);\n\n},{\"./set\":197}],197:[function(require,module,exports){\n\"use strict\";\n\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.SetIncludes = SetIncludes;\nexports.SetIsSubset = SetIsSubset;\nexports.SetDistinct = SetDistinct;\nexports.SetIntersect = SetIntersect;\nexports.SetUnion = SetUnion;\nexports.SetComplement = SetComplement;\nexports.SetIntersectMany = SetIntersectMany;\nexports.SetUnionMany = SetUnionMany;\n/** Returns true if element right is in the set of left */\n// prettier-ignore\nfunction SetIncludes(T, S) {\n  return T.includes(S);\n}\n/** Returns true if left is a subset of right */\nfunction SetIsSubset(T, S) {\n  return T.every(function (L) {\n    return SetIncludes(S, L);\n  });\n}\n/** Returns a distinct set of elements */\nfunction SetDistinct(T) {\n  return _toConsumableArray(new Set(T));\n}\n/** Returns the Intersect of the given sets */\nfunction SetIntersect(T, S) {\n  return T.filter(function (L) {\n    return S.includes(L);\n  });\n}\n/** Returns the Union of the given sets */\nfunction SetUnion(T, S) {\n  return [].concat(_toConsumableArray(T), _toConsumableArray(S));\n}\n/** Returns the Complement by omitting elements in T that are in S */\n// prettier-ignore\nfunction SetComplement(T, S) {\n  return T.filter(function (L) {\n    return !S.includes(L);\n  });\n}\n// prettier-ignore\nfunction SetIntersectManyResolve(T, Init) {\n  return T.reduce(function (Acc, L) {\n    return SetIntersect(Acc, L);\n  }, Init);\n}\n// prettier-ignore\nfunction SetIntersectMany(T) {\n  return T.length === 1 ? T[0]\n  // Use left to initialize the accumulator for resolve\n  : T.length > 1 ? SetIntersectManyResolve(T.slice(1), T[0]) : [];\n}\n/** Returns the Union of multiple sets */\nfunction SetUnionMany(T) {\n  var Acc = [];\n  var _iterator = _createForOfIteratorHelper(T),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var L = _step.value;\n      Acc.push.apply(Acc, _toConsumableArray(L));\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return Acc;\n}\n\n},{}],198:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./static\"), exports);\n\n},{\"./static\":199}],199:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\n},{}],200:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./string\"), exports);\n\n},{\"./string\":201}],201:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.String = _String;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[Json]` Creates a String type */\nfunction _String(options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty({}, index_1.Kind, 'String'), \"type\", 'string'), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],202:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./symbol\"), exports);\n\n},{\"./symbol\":203}],203:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Symbol = _Symbol;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[JavaScript]` Creates a Symbol type */\nfunction _Symbol(options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty({}, index_1.Kind, 'Symbol'), \"type\", 'symbol'), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],204:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./symbols\"), exports);\n\n},{\"./symbols\":205}],205:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Kind = exports.Hint = exports.OptionalKind = exports.ReadonlyKind = exports.TransformKind = void 0;\n/** Symbol key applied to transform types */\nexports.TransformKind = Symbol[\"for\"]('TypeBox.Transform');\n/** Symbol key applied to readonly types */\nexports.ReadonlyKind = Symbol[\"for\"]('TypeBox.Readonly');\n/** Symbol key applied to optional types */\nexports.OptionalKind = Symbol[\"for\"]('TypeBox.Optional');\n/** Symbol key applied to types */\nexports.Hint = Symbol[\"for\"]('TypeBox.Hint');\n/** Symbol key applied to types */\nexports.Kind = Symbol[\"for\"]('TypeBox.Kind');\n\n},{}],206:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TemplateLiteralFiniteError = void 0;\nexports.IsTemplateLiteralExpressionFinite = IsTemplateLiteralExpressionFinite;\nexports.IsTemplateLiteralFinite = IsTemplateLiteralFinite;\nvar parse_1 = require(\"./parse\");\nvar index_1 = require(\"../error/index\");\n// ------------------------------------------------------------------\n// TemplateLiteralFiniteError\n// ------------------------------------------------------------------\nvar TemplateLiteralFiniteError = /*#__PURE__*/function (_index_1$TypeBoxError) {\n  function TemplateLiteralFiniteError() {\n    _classCallCheck(this, TemplateLiteralFiniteError);\n    return _callSuper(this, TemplateLiteralFiniteError, arguments);\n  }\n  _inherits(TemplateLiteralFiniteError, _index_1$TypeBoxError);\n  return _createClass(TemplateLiteralFiniteError);\n}(index_1.TypeBoxError);\nexports.TemplateLiteralFiniteError = TemplateLiteralFiniteError;\n// ------------------------------------------------------------------\n// IsTemplateLiteralFiniteCheck\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction IsNumberExpression(expression) {\n  return expression.type === 'or' && expression.expr.length === 2 && expression.expr[0].type === 'const' && expression.expr[0][\"const\"] === '0' && expression.expr[1].type === 'const' && expression.expr[1][\"const\"] === '[1-9][0-9]*';\n}\n// prettier-ignore\nfunction IsBooleanExpression(expression) {\n  return expression.type === 'or' && expression.expr.length === 2 && expression.expr[0].type === 'const' && expression.expr[0][\"const\"] === 'true' && expression.expr[1].type === 'const' && expression.expr[1][\"const\"] === 'false';\n}\n// prettier-ignore\nfunction IsStringExpression(expression) {\n  return expression.type === 'const' && expression[\"const\"] === '.*';\n}\n// ------------------------------------------------------------------\n// IsTemplateLiteralExpressionFinite\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction IsTemplateLiteralExpressionFinite(expression) {\n  return IsNumberExpression(expression) || IsStringExpression(expression) ? false : IsBooleanExpression(expression) ? true : expression.type === 'and' ? expression.expr.every(function (expr) {\n    return IsTemplateLiteralExpressionFinite(expr);\n  }) : expression.type === 'or' ? expression.expr.every(function (expr) {\n    return IsTemplateLiteralExpressionFinite(expr);\n  }) : expression.type === 'const' ? true : function () {\n    throw new TemplateLiteralFiniteError(\"Unknown expression type\");\n  }();\n}\n/** Returns true if this TemplateLiteral resolves to a finite set of values */\nfunction IsTemplateLiteralFinite(schema) {\n  var expression = (0, parse_1.TemplateLiteralParseExact)(schema.pattern);\n  return IsTemplateLiteralExpressionFinite(expression);\n}\n\n},{\"../error/index\":78,\"./parse\":209}],207:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nvar _marked = /*#__PURE__*/_regeneratorRuntime().mark(GenerateReduce),\n  _marked2 = /*#__PURE__*/_regeneratorRuntime().mark(GenerateAnd),\n  _marked3 = /*#__PURE__*/_regeneratorRuntime().mark(GenerateOr),\n  _marked4 = /*#__PURE__*/_regeneratorRuntime().mark(GenerateConst),\n  _marked5 = /*#__PURE__*/_regeneratorRuntime().mark(TemplateLiteralExpressionGenerate);\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TemplateLiteralGenerateError = void 0;\nexports.TemplateLiteralExpressionGenerate = TemplateLiteralExpressionGenerate;\nexports.TemplateLiteralGenerate = TemplateLiteralGenerate;\nvar finite_1 = require(\"./finite\");\nvar parse_1 = require(\"./parse\");\nvar index_1 = require(\"../error/index\");\n// ------------------------------------------------------------------\n// TemplateLiteralGenerateError\n// ------------------------------------------------------------------\nvar TemplateLiteralGenerateError = /*#__PURE__*/function (_index_1$TypeBoxError) {\n  function TemplateLiteralGenerateError() {\n    _classCallCheck(this, TemplateLiteralGenerateError);\n    return _callSuper(this, TemplateLiteralGenerateError, arguments);\n  }\n  _inherits(TemplateLiteralGenerateError, _index_1$TypeBoxError);\n  return _createClass(TemplateLiteralGenerateError);\n}(index_1.TypeBoxError);\nexports.TemplateLiteralGenerateError = TemplateLiteralGenerateError;\n// ------------------------------------------------------------------\n// TemplateLiteralExpressionGenerate\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction GenerateReduce(buffer) {\n  var _iterator, _step, left, _iterator2, _step2, right;\n  return _regeneratorRuntime().wrap(function GenerateReduce$(_context) {\n    while (1) switch (_context.prev = _context.next) {\n      case 0:\n        if (!(buffer.length === 1)) {\n          _context.next = 3;\n          break;\n        }\n        return _context.delegateYield(buffer[0], \"t0\", 2);\n      case 2:\n        return _context.abrupt(\"return\", _context.t0);\n      case 3:\n        _iterator = _createForOfIteratorHelper(buffer[0]);\n        _context.prev = 4;\n        _iterator.s();\n      case 6:\n        if ((_step = _iterator.n()).done) {\n          _context.next = 27;\n          break;\n        }\n        left = _step.value;\n        _iterator2 = _createForOfIteratorHelper(GenerateReduce(buffer.slice(1)));\n        _context.prev = 9;\n        _iterator2.s();\n      case 11:\n        if ((_step2 = _iterator2.n()).done) {\n          _context.next = 17;\n          break;\n        }\n        right = _step2.value;\n        _context.next = 15;\n        return \"\".concat(left).concat(right);\n      case 15:\n        _context.next = 11;\n        break;\n      case 17:\n        _context.next = 22;\n        break;\n      case 19:\n        _context.prev = 19;\n        _context.t1 = _context[\"catch\"](9);\n        _iterator2.e(_context.t1);\n      case 22:\n        _context.prev = 22;\n        _iterator2.f();\n        return _context.finish(22);\n      case 25:\n        _context.next = 6;\n        break;\n      case 27:\n        _context.next = 32;\n        break;\n      case 29:\n        _context.prev = 29;\n        _context.t2 = _context[\"catch\"](4);\n        _iterator.e(_context.t2);\n      case 32:\n        _context.prev = 32;\n        _iterator.f();\n        return _context.finish(32);\n      case 35:\n      case \"end\":\n        return _context.stop();\n    }\n  }, _marked, null, [[4, 29, 32, 35], [9, 19, 22, 25]]);\n}\n// prettier-ignore\nfunction GenerateAnd(expression) {\n  return _regeneratorRuntime().wrap(function GenerateAnd$(_context2) {\n    while (1) switch (_context2.prev = _context2.next) {\n      case 0:\n        return _context2.delegateYield(GenerateReduce(expression.expr.map(function (expr) {\n          return _toConsumableArray(TemplateLiteralExpressionGenerate(expr));\n        })), \"t0\", 1);\n      case 1:\n        return _context2.abrupt(\"return\", _context2.t0);\n      case 2:\n      case \"end\":\n        return _context2.stop();\n    }\n  }, _marked2);\n}\n// prettier-ignore\nfunction GenerateOr(expression) {\n  var _iterator3, _step3, expr;\n  return _regeneratorRuntime().wrap(function GenerateOr$(_context3) {\n    while (1) switch (_context3.prev = _context3.next) {\n      case 0:\n        _iterator3 = _createForOfIteratorHelper(expression.expr);\n        _context3.prev = 1;\n        _iterator3.s();\n      case 3:\n        if ((_step3 = _iterator3.n()).done) {\n          _context3.next = 8;\n          break;\n        }\n        expr = _step3.value;\n        return _context3.delegateYield(TemplateLiteralExpressionGenerate(expr), \"t0\", 6);\n      case 6:\n        _context3.next = 3;\n        break;\n      case 8:\n        _context3.next = 13;\n        break;\n      case 10:\n        _context3.prev = 10;\n        _context3.t1 = _context3[\"catch\"](1);\n        _iterator3.e(_context3.t1);\n      case 13:\n        _context3.prev = 13;\n        _iterator3.f();\n        return _context3.finish(13);\n      case 16:\n      case \"end\":\n        return _context3.stop();\n    }\n  }, _marked3, null, [[1, 10, 13, 16]]);\n}\n// prettier-ignore\nfunction GenerateConst(expression) {\n  return _regeneratorRuntime().wrap(function GenerateConst$(_context4) {\n    while (1) switch (_context4.prev = _context4.next) {\n      case 0:\n        _context4.next = 2;\n        return expression[\"const\"];\n      case 2:\n        return _context4.abrupt(\"return\", _context4.sent);\n      case 3:\n      case \"end\":\n        return _context4.stop();\n    }\n  }, _marked4);\n}\nfunction TemplateLiteralExpressionGenerate(expression) {\n  return _regeneratorRuntime().wrap(function TemplateLiteralExpressionGenerate$(_context5) {\n    while (1) switch (_context5.prev = _context5.next) {\n      case 0:\n        if (!(expression.type === 'and')) {\n          _context5.next = 5;\n          break;\n        }\n        return _context5.delegateYield(GenerateAnd(expression), \"t1\", 2);\n      case 2:\n        _context5.t0 = _context5.t1;\n        _context5.next = 18;\n        break;\n      case 5:\n        if (!(expression.type === 'or')) {\n          _context5.next = 10;\n          break;\n        }\n        return _context5.delegateYield(GenerateOr(expression), \"t3\", 7);\n      case 7:\n        _context5.t2 = _context5.t3;\n        _context5.next = 17;\n        break;\n      case 10:\n        if (!(expression.type === 'const')) {\n          _context5.next = 15;\n          break;\n        }\n        return _context5.delegateYield(GenerateConst(expression), \"t5\", 12);\n      case 12:\n        _context5.t4 = _context5.t5;\n        _context5.next = 16;\n        break;\n      case 15:\n        _context5.t4 = function () {\n          throw new TemplateLiteralGenerateError('Unknown expression');\n        }();\n      case 16:\n        _context5.t2 = _context5.t4;\n      case 17:\n        _context5.t0 = _context5.t2;\n      case 18:\n        return _context5.abrupt(\"return\", _context5.t0);\n      case 19:\n      case \"end\":\n        return _context5.stop();\n    }\n  }, _marked5);\n}\n/** Generates a tuple of strings from the given TemplateLiteral. Returns an empty tuple if infinite. */\nfunction TemplateLiteralGenerate(schema) {\n  var expression = (0, parse_1.TemplateLiteralParseExact)(schema.pattern);\n  // prettier-ignore\n  return (0, finite_1.IsTemplateLiteralExpressionFinite)(expression) ? _toConsumableArray(TemplateLiteralExpressionGenerate(expression)) : [];\n}\n\n},{\"../error/index\":78,\"./finite\":206,\"./parse\":209}],208:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./finite\"), exports);\n__exportStar(require(\"./generate\"), exports);\n__exportStar(require(\"./syntax\"), exports);\n__exportStar(require(\"./parse\"), exports);\n__exportStar(require(\"./pattern\"), exports);\n__exportStar(require(\"./union\"), exports);\n__exportStar(require(\"./template-literal\"), exports);\n\n},{\"./finite\":206,\"./generate\":207,\"./parse\":209,\"./pattern\":210,\"./syntax\":211,\"./template-literal\":212,\"./union\":213}],209:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TemplateLiteralParserError = void 0;\nexports.TemplateLiteralParse = TemplateLiteralParse;\nexports.TemplateLiteralParseExact = TemplateLiteralParseExact;\nvar index_1 = require(\"../error/index\");\n// ------------------------------------------------------------------\n// TemplateLiteralParserError\n// ------------------------------------------------------------------\nvar TemplateLiteralParserError = /*#__PURE__*/function (_index_1$TypeBoxError) {\n  function TemplateLiteralParserError() {\n    _classCallCheck(this, TemplateLiteralParserError);\n    return _callSuper(this, TemplateLiteralParserError, arguments);\n  }\n  _inherits(TemplateLiteralParserError, _index_1$TypeBoxError);\n  return _createClass(TemplateLiteralParserError);\n}(index_1.TypeBoxError);\nexports.TemplateLiteralParserError = TemplateLiteralParserError;\n// -------------------------------------------------------------------\n// Unescape\n//\n// Unescape for these control characters specifically. Note that this\n// function is only called on non union group content, and where we\n// still want to allow the user to embed control characters in that\n// content. For review.\n// -------------------------------------------------------------------\n// prettier-ignore\nfunction Unescape(pattern) {\n  return pattern.replace(/\\\\\\$/g, '$').replace(/\\\\\\*/g, '*').replace(/\\\\\\^/g, '^').replace(/\\\\\\|/g, '|').replace(/\\\\\\(/g, '(').replace(/\\\\\\)/g, ')');\n}\n// -------------------------------------------------------------------\n// Control Characters\n// -------------------------------------------------------------------\nfunction IsNonEscaped(pattern, index, _char) {\n  return pattern[index] === _char && pattern.charCodeAt(index - 1) !== 92;\n}\nfunction IsOpenParen(pattern, index) {\n  return IsNonEscaped(pattern, index, '(');\n}\nfunction IsCloseParen(pattern, index) {\n  return IsNonEscaped(pattern, index, ')');\n}\nfunction IsSeparator(pattern, index) {\n  return IsNonEscaped(pattern, index, '|');\n}\n// -------------------------------------------------------------------\n// Control Groups\n// -------------------------------------------------------------------\nfunction IsGroup(pattern) {\n  if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1))) return false;\n  var count = 0;\n  for (var index = 0; index < pattern.length; index++) {\n    if (IsOpenParen(pattern, index)) count += 1;\n    if (IsCloseParen(pattern, index)) count -= 1;\n    if (count === 0 && index !== pattern.length - 1) return false;\n  }\n  return true;\n}\n// prettier-ignore\nfunction InGroup(pattern) {\n  return pattern.slice(1, pattern.length - 1);\n}\n// prettier-ignore\nfunction IsPrecedenceOr(pattern) {\n  var count = 0;\n  for (var index = 0; index < pattern.length; index++) {\n    if (IsOpenParen(pattern, index)) count += 1;\n    if (IsCloseParen(pattern, index)) count -= 1;\n    if (IsSeparator(pattern, index) && count === 0) return true;\n  }\n  return false;\n}\n// prettier-ignore\nfunction IsPrecedenceAnd(pattern) {\n  for (var index = 0; index < pattern.length; index++) {\n    if (IsOpenParen(pattern, index)) return true;\n  }\n  return false;\n}\n// prettier-ignore\nfunction Or(pattern) {\n  var count = 0,\n    start = 0;\n  var expressions = [];\n  for (var index = 0; index < pattern.length; index++) {\n    if (IsOpenParen(pattern, index)) count += 1;\n    if (IsCloseParen(pattern, index)) count -= 1;\n    if (IsSeparator(pattern, index) && count === 0) {\n      var _range = pattern.slice(start, index);\n      if (_range.length > 0) expressions.push(TemplateLiteralParse(_range));\n      start = index + 1;\n    }\n  }\n  var range = pattern.slice(start);\n  if (range.length > 0) expressions.push(TemplateLiteralParse(range));\n  if (expressions.length === 0) return {\n    type: 'const',\n    \"const\": ''\n  };\n  if (expressions.length === 1) return expressions[0];\n  return {\n    type: 'or',\n    expr: expressions\n  };\n}\n// prettier-ignore\nfunction And(pattern) {\n  function Group(value, index) {\n    if (!IsOpenParen(value, index)) throw new TemplateLiteralParserError(\"TemplateLiteralParser: Index must point to open parens\");\n    var count = 0;\n    for (var scan = index; scan < value.length; scan++) {\n      if (IsOpenParen(value, scan)) count += 1;\n      if (IsCloseParen(value, scan)) count -= 1;\n      if (count === 0) return [index, scan];\n    }\n    throw new TemplateLiteralParserError(\"TemplateLiteralParser: Unclosed group parens in expression\");\n  }\n  function Range(pattern, index) {\n    for (var scan = index; scan < pattern.length; scan++) {\n      if (IsOpenParen(pattern, scan)) return [index, scan];\n    }\n    return [index, pattern.length];\n  }\n  var expressions = [];\n  for (var index = 0; index < pattern.length; index++) {\n    if (IsOpenParen(pattern, index)) {\n      var _Group = Group(pattern, index),\n        _Group2 = _slicedToArray(_Group, 2),\n        start = _Group2[0],\n        end = _Group2[1];\n      var range = pattern.slice(start, end + 1);\n      expressions.push(TemplateLiteralParse(range));\n      index = end;\n    } else {\n      var _Range = Range(pattern, index),\n        _Range2 = _slicedToArray(_Range, 2),\n        _start = _Range2[0],\n        _end = _Range2[1];\n      var _range2 = pattern.slice(_start, _end);\n      if (_range2.length > 0) expressions.push(TemplateLiteralParse(_range2));\n      index = _end - 1;\n    }\n  }\n  return expressions.length === 0 ? {\n    type: 'const',\n    \"const\": ''\n  } : expressions.length === 1 ? expressions[0] : {\n    type: 'and',\n    expr: expressions\n  };\n}\n// ------------------------------------------------------------------\n// TemplateLiteralParse\n// ------------------------------------------------------------------\n/** Parses a pattern and returns an expression tree */\nfunction TemplateLiteralParse(pattern) {\n  // prettier-ignore\n  return IsGroup(pattern) ? TemplateLiteralParse(InGroup(pattern)) : IsPrecedenceOr(pattern) ? Or(pattern) : IsPrecedenceAnd(pattern) ? And(pattern) : {\n    type: 'const',\n    \"const\": Unescape(pattern)\n  };\n}\n// ------------------------------------------------------------------\n// TemplateLiteralParseExact\n// ------------------------------------------------------------------\n/** Parses a pattern and strips forward and trailing ^ and $ */\nfunction TemplateLiteralParseExact(pattern) {\n  return TemplateLiteralParse(pattern.slice(1, pattern.length - 1));\n}\n\n},{\"../error/index\":78}],210:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TemplateLiteralPatternError = void 0;\nexports.TemplateLiteralPattern = TemplateLiteralPattern;\nvar index_1 = require(\"../patterns/index\");\nvar index_2 = require(\"../symbols/index\");\nvar index_3 = require(\"../error/index\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\n// ------------------------------------------------------------------\n// TemplateLiteralPatternError\n// ------------------------------------------------------------------\nvar TemplateLiteralPatternError = /*#__PURE__*/function (_index_3$TypeBoxError) {\n  function TemplateLiteralPatternError() {\n    _classCallCheck(this, TemplateLiteralPatternError);\n    return _callSuper(this, TemplateLiteralPatternError, arguments);\n  }\n  _inherits(TemplateLiteralPatternError, _index_3$TypeBoxError);\n  return _createClass(TemplateLiteralPatternError);\n}(index_3.TypeBoxError);\nexports.TemplateLiteralPatternError = TemplateLiteralPatternError;\n// ------------------------------------------------------------------\n// TemplateLiteralPattern\n// ------------------------------------------------------------------\nfunction Escape(value) {\n  return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n// prettier-ignore\nfunction Visit(schema, acc) {\n  return (0, kind_1.IsTemplateLiteral)(schema) ? schema.pattern.slice(1, schema.pattern.length - 1) : (0, kind_1.IsUnion)(schema) ? \"(\".concat(schema.anyOf.map(function (schema) {\n    return Visit(schema, acc);\n  }).join('|'), \")\") : (0, kind_1.IsNumber)(schema) ? \"\".concat(acc).concat(index_1.PatternNumber) : (0, kind_1.IsInteger)(schema) ? \"\".concat(acc).concat(index_1.PatternNumber) : (0, kind_1.IsBigInt)(schema) ? \"\".concat(acc).concat(index_1.PatternNumber) : (0, kind_1.IsString)(schema) ? \"\".concat(acc).concat(index_1.PatternString) : (0, kind_1.IsLiteral)(schema) ? \"\".concat(acc).concat(Escape(schema[\"const\"].toString())) : (0, kind_1.IsBoolean)(schema) ? \"\".concat(acc).concat(index_1.PatternBoolean) : function () {\n    throw new TemplateLiteralPatternError(\"Unexpected Kind '\".concat(schema[index_2.Kind], \"'\"));\n  }();\n}\nfunction TemplateLiteralPattern(kinds) {\n  return \"^\".concat(kinds.map(function (schema) {\n    return Visit(schema, '');\n  }).join(''), \"$\");\n}\n\n},{\"../error/index\":78,\"../guard/kind\":96,\"../patterns/index\":162,\"../symbols/index\":204}],211:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nvar _marked = /*#__PURE__*/_regeneratorRuntime().mark(FromUnion),\n  _marked2 = /*#__PURE__*/_regeneratorRuntime().mark(FromTerminal),\n  _marked3 = /*#__PURE__*/_regeneratorRuntime().mark(FromSyntax);\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TemplateLiteralSyntax = TemplateLiteralSyntax;\nvar index_1 = require(\"../literal/index\");\nvar index_2 = require(\"../boolean/index\");\nvar index_3 = require(\"../bigint/index\");\nvar index_4 = require(\"../number/index\");\nvar index_5 = require(\"../string/index\");\nvar index_6 = require(\"../union/index\");\nvar index_7 = require(\"../never/index\");\n// ------------------------------------------------------------------\n// SyntaxParsers\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction FromUnion(syntax) {\n  var trim;\n  return _regeneratorRuntime().wrap(function FromUnion$(_context) {\n    while (1) switch (_context.prev = _context.next) {\n      case 0:\n        trim = syntax.trim().replace(/\"|'/g, '');\n        if (!(trim === 'boolean')) {\n          _context.next = 7;\n          break;\n        }\n        _context.next = 4;\n        return (0, index_2.Boolean)();\n      case 4:\n        _context.t0 = _context.sent;\n        _context.next = 31;\n        break;\n      case 7:\n        if (!(trim === 'number')) {\n          _context.next = 13;\n          break;\n        }\n        _context.next = 10;\n        return (0, index_4.Number)();\n      case 10:\n        _context.t1 = _context.sent;\n        _context.next = 30;\n        break;\n      case 13:\n        if (!(trim === 'bigint')) {\n          _context.next = 19;\n          break;\n        }\n        _context.next = 16;\n        return (0, index_3.BigInt)();\n      case 16:\n        _context.t2 = _context.sent;\n        _context.next = 29;\n        break;\n      case 19:\n        if (!(trim === 'string')) {\n          _context.next = 25;\n          break;\n        }\n        _context.next = 22;\n        return (0, index_5.String)();\n      case 22:\n        _context.t3 = _context.sent;\n        _context.next = 28;\n        break;\n      case 25:\n        _context.next = 27;\n        return function () {\n          var literals = trim.split('|').map(function (literal) {\n            return (0, index_1.Literal)(literal.trim());\n          });\n          return literals.length === 0 ? (0, index_7.Never)() : literals.length === 1 ? literals[0] : (0, index_6.UnionEvaluated)(literals);\n        }();\n      case 27:\n        _context.t3 = _context.sent;\n      case 28:\n        _context.t2 = _context.t3;\n      case 29:\n        _context.t1 = _context.t2;\n      case 30:\n        _context.t0 = _context.t1;\n      case 31:\n        return _context.abrupt(\"return\", _context.t0);\n      case 32:\n      case \"end\":\n        return _context.stop();\n    }\n  }, _marked);\n}\n// prettier-ignore\nfunction FromTerminal(syntax) {\n  var L, R, i, _L, _R;\n  return _regeneratorRuntime().wrap(function FromTerminal$(_context2) {\n    while (1) switch (_context2.prev = _context2.next) {\n      case 0:\n        if (!(syntax[1] !== '{')) {\n          _context2.next = 5;\n          break;\n        }\n        L = (0, index_1.Literal)('$');\n        R = FromSyntax(syntax.slice(1));\n        return _context2.delegateYield([L].concat(_toConsumableArray(R)), \"t0\", 4);\n      case 4:\n        return _context2.abrupt(\"return\", _context2.t0);\n      case 5:\n        i = 2;\n      case 6:\n        if (!(i < syntax.length)) {\n          _context2.next = 15;\n          break;\n        }\n        if (!(syntax[i] === '}')) {\n          _context2.next = 12;\n          break;\n        }\n        _L = FromUnion(syntax.slice(2, i));\n        _R = FromSyntax(syntax.slice(i + 1));\n        return _context2.delegateYield([].concat(_toConsumableArray(_L), _toConsumableArray(_R)), \"t1\", 11);\n      case 11:\n        return _context2.abrupt(\"return\", _context2.t1);\n      case 12:\n        i++;\n        _context2.next = 6;\n        break;\n      case 15:\n        _context2.next = 17;\n        return (0, index_1.Literal)(syntax);\n      case 17:\n      case \"end\":\n        return _context2.stop();\n    }\n  }, _marked2);\n}\n// prettier-ignore\nfunction FromSyntax(syntax) {\n  var i, L, R;\n  return _regeneratorRuntime().wrap(function FromSyntax$(_context3) {\n    while (1) switch (_context3.prev = _context3.next) {\n      case 0:\n        i = 0;\n      case 1:\n        if (!(i < syntax.length)) {\n          _context3.next = 10;\n          break;\n        }\n        if (!(syntax[i] === '$')) {\n          _context3.next = 7;\n          break;\n        }\n        L = (0, index_1.Literal)(syntax.slice(0, i));\n        R = FromTerminal(syntax.slice(i));\n        return _context3.delegateYield([L].concat(_toConsumableArray(R)), \"t0\", 6);\n      case 6:\n        return _context3.abrupt(\"return\", _context3.t0);\n      case 7:\n        i++;\n        _context3.next = 1;\n        break;\n      case 10:\n        _context3.next = 12;\n        return (0, index_1.Literal)(syntax);\n      case 12:\n      case \"end\":\n        return _context3.stop();\n    }\n  }, _marked3);\n}\n/** Parses TemplateLiteralSyntax and returns a tuple of TemplateLiteralKinds */\nfunction TemplateLiteralSyntax(syntax) {\n  return _toConsumableArray(FromSyntax(syntax));\n}\n\n},{\"../bigint/index\":52,\"../boolean/index\":54,\"../literal/index\":131,\"../never/index\":140,\"../number/index\":146,\"../string/index\":200,\"../union/index\":226}],212:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TemplateLiteral = TemplateLiteral;\nvar type_1 = require(\"../create/type\");\nvar syntax_1 = require(\"./syntax\");\nvar pattern_1 = require(\"./pattern\");\nvar value_1 = require(\"../guard/value\");\nvar index_1 = require(\"../symbols/index\");\n/** `[Json]` Creates a TemplateLiteral type */\n// prettier-ignore\nfunction TemplateLiteral(unresolved, options) {\n  var pattern = (0, value_1.IsString)(unresolved) ? (0, pattern_1.TemplateLiteralPattern)((0, syntax_1.TemplateLiteralSyntax)(unresolved)) : (0, pattern_1.TemplateLiteralPattern)(unresolved);\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty(_defineProperty({}, index_1.Kind, 'TemplateLiteral'), \"type\", 'string'), \"pattern\", pattern), options);\n}\n\n},{\"../create/type\":70,\"../guard/value\":98,\"../symbols/index\":204,\"./pattern\":210,\"./syntax\":211}],213:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TemplateLiteralToUnion = TemplateLiteralToUnion;\nvar index_1 = require(\"../union/index\");\nvar index_2 = require(\"../literal/index\");\nvar generate_1 = require(\"./generate\");\n/** Returns a Union from the given TemplateLiteral */\nfunction TemplateLiteralToUnion(schema) {\n  var R = (0, generate_1.TemplateLiteralGenerate)(schema);\n  var L = R.map(function (S) {\n    return (0, index_2.Literal)(S);\n  });\n  return (0, index_1.UnionEvaluated)(L);\n}\n\n},{\"../literal/index\":131,\"../union/index\":226,\"./generate\":207}],214:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./transform\"), exports);\n\n},{\"./transform\":215}],215:[function(require,module,exports){\n\"use strict\";\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TransformEncodeBuilder = exports.TransformDecodeBuilder = void 0;\nexports.Transform = Transform;\nvar index_1 = require(\"../symbols/index\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\n// ------------------------------------------------------------------\n// TransformBuilders\n// ------------------------------------------------------------------\nvar TransformDecodeBuilder = /*#__PURE__*/function () {\n  function TransformDecodeBuilder(schema) {\n    _classCallCheck(this, TransformDecodeBuilder);\n    this.schema = schema;\n  }\n  return _createClass(TransformDecodeBuilder, [{\n    key: \"Decode\",\n    value: function Decode(decode) {\n      return new TransformEncodeBuilder(this.schema, decode);\n    }\n  }]);\n}();\nexports.TransformDecodeBuilder = TransformDecodeBuilder;\n// prettier-ignore\nvar TransformEncodeBuilder = /*#__PURE__*/function () {\n  function TransformEncodeBuilder(schema, decode) {\n    _classCallCheck(this, TransformEncodeBuilder);\n    this.schema = schema;\n    this.decode = decode;\n  }\n  return _createClass(TransformEncodeBuilder, [{\n    key: \"EncodeTransform\",\n    value: function EncodeTransform(encode, schema) {\n      var _this = this;\n      var Encode = function Encode(value) {\n        return schema[index_1.TransformKind].Encode(encode(value));\n      };\n      var Decode = function Decode(value) {\n        return _this.decode(schema[index_1.TransformKind].Decode(value));\n      };\n      var Codec = {\n        Encode: Encode,\n        Decode: Decode\n      };\n      return _objectSpread(_objectSpread({}, schema), {}, _defineProperty({}, index_1.TransformKind, Codec));\n    }\n  }, {\n    key: \"EncodeSchema\",\n    value: function EncodeSchema(encode, schema) {\n      var Codec = {\n        Decode: this.decode,\n        Encode: encode\n      };\n      return _objectSpread(_objectSpread({}, schema), {}, _defineProperty({}, index_1.TransformKind, Codec));\n    }\n  }, {\n    key: \"Encode\",\n    value: function Encode(encode) {\n      return (0, kind_1.IsTransform)(this.schema) ? this.EncodeTransform(encode, this.schema) : this.EncodeSchema(encode, this.schema);\n    }\n  }]);\n}();\nexports.TransformEncodeBuilder = TransformEncodeBuilder;\n/** `[Json]` Creates a Transform type */\nfunction Transform(schema) {\n  return new TransformDecodeBuilder(schema);\n}\n\n},{\"../guard/kind\":96,\"../symbols/index\":204}],216:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./tuple\"), exports);\n\n},{\"./tuple\":217}],217:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Tuple = Tuple;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[Json]` Creates a Tuple type */\nfunction Tuple(types, options) {\n  // prettier-ignore\n  return (0, type_1.CreateType)(types.length > 0 ? _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, index_1.Kind, 'Tuple'), \"type\", 'array'), \"items\", types), \"additionalItems\", false), \"minItems\", types.length), \"maxItems\", types.length) : _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, index_1.Kind, 'Tuple'), \"type\", 'array'), \"minItems\", types.length), \"maxItems\", types.length), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],218:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Type = exports.JavaScriptTypeBuilder = exports.JsonTypeBuilder = void 0;\n// ------------------------------------------------------------------\n// JsonTypeBuilder\n// ------------------------------------------------------------------\nvar json_1 = require(\"./json\");\nObject.defineProperty(exports, \"JsonTypeBuilder\", {\n  enumerable: true,\n  get: function get() {\n    return json_1.JsonTypeBuilder;\n  }\n});\n// ------------------------------------------------------------------\n// JavaScriptTypeBuilder\n// ------------------------------------------------------------------\nvar TypeBuilder = require(\"./type\");\nvar javascript_1 = require(\"./javascript\");\nObject.defineProperty(exports, \"JavaScriptTypeBuilder\", {\n  enumerable: true,\n  get: function get() {\n    return javascript_1.JavaScriptTypeBuilder;\n  }\n});\n/** JavaScript Type Builder with Static Resolution for TypeScript */\nvar Type = TypeBuilder;\nexports.Type = Type;\n\n},{\"./javascript\":219,\"./json\":220,\"./type\":221}],219:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.JavaScriptTypeBuilder = void 0;\nvar json_1 = require(\"./json\");\nvar index_1 = require(\"../argument/index\");\nvar index_2 = require(\"../async-iterator/index\");\nvar index_3 = require(\"../awaited/index\");\nvar index_4 = require(\"../bigint/index\");\nvar index_5 = require(\"../constructor/index\");\nvar index_6 = require(\"../constructor-parameters/index\");\nvar index_7 = require(\"../date/index\");\nvar index_8 = require(\"../function/index\");\nvar index_9 = require(\"../instance-type/index\");\nvar index_10 = require(\"../instantiate/index\");\nvar index_11 = require(\"../iterator/index\");\nvar index_12 = require(\"../parameters/index\");\nvar index_13 = require(\"../promise/index\");\nvar index_14 = require(\"../regexp/index\");\nvar index_15 = require(\"../return-type/index\");\nvar index_16 = require(\"../symbol/index\");\nvar index_17 = require(\"../uint8array/index\");\nvar index_18 = require(\"../undefined/index\");\nvar index_19 = require(\"../void/index\");\n/** JavaScript Type Builder with Static Resolution for TypeScript */\nvar JavaScriptTypeBuilder = /*#__PURE__*/function (_json_1$JsonTypeBuild) {\n  function JavaScriptTypeBuilder() {\n    _classCallCheck(this, JavaScriptTypeBuilder);\n    return _callSuper(this, JavaScriptTypeBuilder, arguments);\n  }\n  _inherits(JavaScriptTypeBuilder, _json_1$JsonTypeBuild);\n  return _createClass(JavaScriptTypeBuilder, [{\n    key: \"Argument\",\n    value: /** `[JavaScript]` Creates a Generic Argument Type */\n    function Argument(index) {\n      return (0, index_1.Argument)(index);\n    }\n    /** `[JavaScript]` Creates a AsyncIterator type */\n  }, {\n    key: \"AsyncIterator\",\n    value: function AsyncIterator(items, options) {\n      return (0, index_2.AsyncIterator)(items, options);\n    }\n    /** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */\n  }, {\n    key: \"Awaited\",\n    value: function Awaited(schema, options) {\n      return (0, index_3.Awaited)(schema, options);\n    }\n    /** `[JavaScript]` Creates a BigInt type */\n  }, {\n    key: \"BigInt\",\n    value: function BigInt(options) {\n      return (0, index_4.BigInt)(options);\n    }\n    /** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */\n  }, {\n    key: \"ConstructorParameters\",\n    value: function ConstructorParameters(schema, options) {\n      return (0, index_6.ConstructorParameters)(schema, options);\n    }\n    /** `[JavaScript]` Creates a Constructor type */\n  }, {\n    key: \"Constructor\",\n    value: function Constructor(parameters, instanceType, options) {\n      return (0, index_5.Constructor)(parameters, instanceType, options);\n    }\n    /** `[JavaScript]` Creates a Date type */\n  }, {\n    key: \"Date\",\n    value: function Date() {\n      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n      return (0, index_7.Date)(options);\n    }\n    /** `[JavaScript]` Creates a Function type */\n  }, {\n    key: \"Function\",\n    value: function Function(parameters, returnType, options) {\n      return (0, index_8.Function)(parameters, returnType, options);\n    }\n    /** `[JavaScript]` Extracts the InstanceType from the given Constructor type */\n  }, {\n    key: \"InstanceType\",\n    value: function InstanceType(schema, options) {\n      return (0, index_9.InstanceType)(schema, options);\n    }\n    /** `[JavaScript]` Instantiates a type with the given parameters */\n  }, {\n    key: \"Instantiate\",\n    value: function Instantiate(schema, parameters) {\n      return (0, index_10.Instantiate)(schema, parameters);\n    }\n    /** `[JavaScript]` Creates an Iterator type */\n  }, {\n    key: \"Iterator\",\n    value: function Iterator(items, options) {\n      return (0, index_11.Iterator)(items, options);\n    }\n    /** `[JavaScript]` Extracts the Parameters from the given Function type */\n  }, {\n    key: \"Parameters\",\n    value: function Parameters(schema, options) {\n      return (0, index_12.Parameters)(schema, options);\n    }\n    /** `[JavaScript]` Creates a Promise type */\n  }, {\n    key: \"Promise\",\n    value: function Promise(item, options) {\n      return (0, index_13.Promise)(item, options);\n    }\n    /** `[JavaScript]` Creates a RegExp type */\n  }, {\n    key: \"RegExp\",\n    value: function RegExp(unresolved, options) {\n      return (0, index_14.RegExp)(unresolved, options);\n    }\n    /** `[JavaScript]` Extracts the ReturnType from the given Function type */\n  }, {\n    key: \"ReturnType\",\n    value: function ReturnType(type, options) {\n      return (0, index_15.ReturnType)(type, options);\n    }\n    /** `[JavaScript]` Creates a Symbol type */\n  }, {\n    key: \"Symbol\",\n    value: function _Symbol(options) {\n      return (0, index_16.Symbol)(options);\n    }\n    /** `[JavaScript]` Creates a Undefined type */\n  }, {\n    key: \"Undefined\",\n    value: function Undefined(options) {\n      return (0, index_18.Undefined)(options);\n    }\n    /** `[JavaScript]` Creates a Uint8Array type */\n  }, {\n    key: \"Uint8Array\",\n    value: function Uint8Array(options) {\n      return (0, index_17.Uint8Array)(options);\n    }\n    /** `[JavaScript]` Creates a Void type */\n  }, {\n    key: \"Void\",\n    value: function Void(options) {\n      return (0, index_19.Void)(options);\n    }\n  }]);\n}(json_1.JsonTypeBuilder);\nexports.JavaScriptTypeBuilder = JavaScriptTypeBuilder;\n\n},{\"../argument/index\":44,\"../async-iterator/index\":48,\"../awaited/index\":50,\"../bigint/index\":52,\"../constructor-parameters/index\":65,\"../constructor/index\":67,\"../date/index\":72,\"../function/index\":94,\"../instance-type/index\":106,\"../instantiate/index\":108,\"../iterator/index\":124,\"../parameters/index\":157,\"../promise/index\":168,\"../regexp/index\":181,\"../return-type/index\":191,\"../symbol/index\":202,\"../uint8array/index\":222,\"../undefined/index\":224,\"../void/index\":235,\"./json\":220}],220:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.JsonTypeBuilder = void 0;\nvar index_1 = require(\"../any/index\");\nvar index_2 = require(\"../array/index\");\nvar index_3 = require(\"../boolean/index\");\nvar index_4 = require(\"../composite/index\");\nvar index_5 = require(\"../const/index\");\nvar index_6 = require(\"../enum/index\");\nvar index_7 = require(\"../exclude/index\");\nvar index_8 = require(\"../extends/index\");\nvar index_9 = require(\"../extract/index\");\nvar index_10 = require(\"../indexed/index\");\nvar index_11 = require(\"../integer/index\");\nvar index_12 = require(\"../intersect/index\");\nvar index_13 = require(\"../intrinsic/index\");\nvar index_14 = require(\"../keyof/index\");\nvar index_15 = require(\"../literal/index\");\nvar index_16 = require(\"../mapped/index\");\nvar index_17 = require(\"../never/index\");\nvar index_18 = require(\"../not/index\");\nvar index_19 = require(\"../null/index\");\nvar index_20 = require(\"../module/index\");\nvar index_21 = require(\"../number/index\");\nvar index_22 = require(\"../object/index\");\nvar index_23 = require(\"../omit/index\");\nvar index_24 = require(\"../optional/index\");\nvar index_25 = require(\"../partial/index\");\nvar index_26 = require(\"../pick/index\");\nvar index_27 = require(\"../readonly/index\");\nvar index_28 = require(\"../readonly-optional/index\");\nvar index_29 = require(\"../record/index\");\nvar index_30 = require(\"../recursive/index\");\nvar index_31 = require(\"../ref/index\");\nvar index_32 = require(\"../required/index\");\nvar index_33 = require(\"../rest/index\");\nvar index_34 = require(\"../string/index\");\nvar index_35 = require(\"../template-literal/index\");\nvar index_36 = require(\"../transform/index\");\nvar index_37 = require(\"../tuple/index\");\nvar index_38 = require(\"../union/index\");\nvar index_39 = require(\"../unknown/index\");\nvar index_40 = require(\"../unsafe/index\");\n/** Json Type Builder with Static Resolution for TypeScript */\nvar JsonTypeBuilder = /*#__PURE__*/function () {\n  function JsonTypeBuilder() {\n    _classCallCheck(this, JsonTypeBuilder);\n  }\n  return _createClass(JsonTypeBuilder, [{\n    key: \"ReadonlyOptional\",\n    value:\n    // ------------------------------------------------------------------------\n    // Modifiers\n    // ------------------------------------------------------------------------\n    /** `[Json]` Creates a Readonly and Optional property */\n    function ReadonlyOptional(type) {\n      return (0, index_28.ReadonlyOptional)(type);\n    }\n    /** `[Json]` Creates a Readonly property */\n  }, {\n    key: \"Readonly\",\n    value: function Readonly(type, enable) {\n      return (0, index_27.Readonly)(type, enable !== null && enable !== void 0 ? enable : true);\n    }\n    /** `[Json]` Creates a Optional property */\n  }, {\n    key: \"Optional\",\n    value: function Optional(type, enable) {\n      return (0, index_24.Optional)(type, enable !== null && enable !== void 0 ? enable : true);\n    }\n    // ------------------------------------------------------------------------\n    // Types\n    // ------------------------------------------------------------------------\n    /** `[Json]` Creates an Any type */\n  }, {\n    key: \"Any\",\n    value: function Any(options) {\n      return (0, index_1.Any)(options);\n    }\n    /** `[Json]` Creates an Array type */\n  }, {\n    key: \"Array\",\n    value: function Array(items, options) {\n      return (0, index_2.Array)(items, options);\n    }\n    /** `[Json]` Creates a Boolean type */\n  }, {\n    key: \"Boolean\",\n    value: function Boolean(options) {\n      return (0, index_3.Boolean)(options);\n    }\n    /** `[Json]` Intrinsic function to Capitalize LiteralString types */\n  }, {\n    key: \"Capitalize\",\n    value: function Capitalize(schema, options) {\n      return (0, index_13.Capitalize)(schema, options);\n    }\n    /** `[Json]` Creates a Composite object type */\n  }, {\n    key: \"Composite\",\n    value: function Composite(schemas, options) {\n      return (0, index_4.Composite)(schemas, options); // (error) TS 5.4.0-dev - review TComposite implementation\n    }\n    /** `[JavaScript]` Creates a readonly const type from the given value. */\n  }, {\n    key: \"Const\",\n    value: function Const(value, options) {\n      return (0, index_5.Const)(value, options);\n    }\n    /** `[Json]` Creates a Enum type */\n  }, {\n    key: \"Enum\",\n    value: function Enum(item, options) {\n      return (0, index_6.Enum)(item, options);\n    }\n    /** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */\n  }, {\n    key: \"Exclude\",\n    value: function Exclude(unionType, excludedMembers, options) {\n      return (0, index_7.Exclude)(unionType, excludedMembers, options);\n    }\n    /** `[Json]` Creates a Conditional type */\n  }, {\n    key: \"Extends\",\n    value: function Extends(L, R, T, F, options) {\n      return (0, index_8.Extends)(L, R, T, F, options);\n    }\n    /** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */\n  }, {\n    key: \"Extract\",\n    value: function Extract(type, union, options) {\n      return (0, index_9.Extract)(type, union, options);\n    }\n    /** `[Json]` Returns an Indexed property type for the given keys */\n  }, {\n    key: \"Index\",\n    value: function Index(type, key, options) {\n      return (0, index_10.Index)(type, key, options);\n    }\n    /** `[Json]` Creates an Integer type */\n  }, {\n    key: \"Integer\",\n    value: function Integer(options) {\n      return (0, index_11.Integer)(options);\n    }\n    /** `[Json]` Creates an Intersect type */\n  }, {\n    key: \"Intersect\",\n    value: function Intersect(types, options) {\n      return (0, index_12.Intersect)(types, options);\n    }\n    /** `[Json]` Creates a KeyOf type */\n  }, {\n    key: \"KeyOf\",\n    value: function KeyOf(type, options) {\n      return (0, index_14.KeyOf)(type, options);\n    }\n    /** `[Json]` Creates a Literal type */\n  }, {\n    key: \"Literal\",\n    value: function Literal(literalValue, options) {\n      return (0, index_15.Literal)(literalValue, options);\n    }\n    /** `[Json]` Intrinsic function to Lowercase LiteralString types */\n  }, {\n    key: \"Lowercase\",\n    value: function Lowercase(type, options) {\n      return (0, index_13.Lowercase)(type, options);\n    }\n    /** `[Json]` Creates a Mapped object type */\n  }, {\n    key: \"Mapped\",\n    value: function Mapped(key, map, options) {\n      return (0, index_16.Mapped)(key, map, options);\n    }\n    /** `[Json]` Creates a Type Definition Module. */\n  }, {\n    key: \"Module\",\n    value: function Module(properties) {\n      return (0, index_20.Module)(properties);\n    }\n    /** `[Json]` Creates a Never type */\n  }, {\n    key: \"Never\",\n    value: function Never(options) {\n      return (0, index_17.Never)(options);\n    }\n    /** `[Json]` Creates a Not type */\n  }, {\n    key: \"Not\",\n    value: function Not(type, options) {\n      return (0, index_18.Not)(type, options);\n    }\n    /** `[Json]` Creates a Null type */\n  }, {\n    key: \"Null\",\n    value: function Null(options) {\n      return (0, index_19.Null)(options);\n    }\n    /** `[Json]` Creates a Number type */\n  }, {\n    key: \"Number\",\n    value: function Number(options) {\n      return (0, index_21.Number)(options);\n    }\n    /** `[Json]` Creates an Object type */\n  }, {\n    key: \"Object\",\n    value: function Object(properties, options) {\n      return (0, index_22.Object)(properties, options);\n    }\n    /** `[Json]` Constructs a type whose keys are omitted from the given type */\n  }, {\n    key: \"Omit\",\n    value: function Omit(schema, selector, options) {\n      return (0, index_23.Omit)(schema, selector, options);\n    }\n    /** `[Json]` Constructs a type where all properties are optional */\n  }, {\n    key: \"Partial\",\n    value: function Partial(type, options) {\n      return (0, index_25.Partial)(type, options);\n    }\n    /** `[Json]` Constructs a type whose keys are picked from the given type */\n  }, {\n    key: \"Pick\",\n    value: function Pick(type, key, options) {\n      return (0, index_26.Pick)(type, key, options);\n    }\n    /** `[Json]` Creates a Record type */\n  }, {\n    key: \"Record\",\n    value: function Record(key, value, options) {\n      return (0, index_29.Record)(key, value, options);\n    }\n    /** `[Json]` Creates a Recursive type */\n  }, {\n    key: \"Recursive\",\n    value: function Recursive(callback, options) {\n      return (0, index_30.Recursive)(callback, options);\n    }\n    /** `[Json]` Creates a Ref type. The referenced type must contain a $id */\n  }, {\n    key: \"Ref\",\n    value: function Ref() {\n      return (0, index_31.Ref)(arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1]);\n    }\n    /** `[Json]` Constructs a type where all properties are required */\n  }, {\n    key: \"Required\",\n    value: function Required(type, options) {\n      return (0, index_32.Required)(type, options);\n    }\n    /** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */\n  }, {\n    key: \"Rest\",\n    value: function Rest(type) {\n      return (0, index_33.Rest)(type);\n    }\n    /** `[Json]` Creates a String type */\n  }, {\n    key: \"String\",\n    value: function String(options) {\n      return (0, index_34.String)(options);\n    }\n    /** `[Json]` Creates a TemplateLiteral type */\n  }, {\n    key: \"TemplateLiteral\",\n    value: function TemplateLiteral(unresolved, options) {\n      return (0, index_35.TemplateLiteral)(unresolved, options);\n    }\n    /** `[Json]` Creates a Transform type */\n  }, {\n    key: \"Transform\",\n    value: function Transform(type) {\n      return (0, index_36.Transform)(type);\n    }\n    /** `[Json]` Creates a Tuple type */\n  }, {\n    key: \"Tuple\",\n    value: function Tuple(types, options) {\n      return (0, index_37.Tuple)(types, options);\n    }\n    /** `[Json]` Intrinsic function to Uncapitalize LiteralString types */\n  }, {\n    key: \"Uncapitalize\",\n    value: function Uncapitalize(type, options) {\n      return (0, index_13.Uncapitalize)(type, options);\n    }\n    /** `[Json]` Creates a Union type */\n  }, {\n    key: \"Union\",\n    value: function Union(types, options) {\n      return (0, index_38.Union)(types, options);\n    }\n    /** `[Json]` Creates an Unknown type */\n  }, {\n    key: \"Unknown\",\n    value: function Unknown(options) {\n      return (0, index_39.Unknown)(options);\n    }\n    /** `[Json]` Creates a Unsafe type that will infers as the generic argument T */\n  }, {\n    key: \"Unsafe\",\n    value: function Unsafe(options) {\n      return (0, index_40.Unsafe)(options);\n    }\n    /** `[Json]` Intrinsic function to Uppercase LiteralString types */\n  }, {\n    key: \"Uppercase\",\n    value: function Uppercase(schema, options) {\n      return (0, index_13.Uppercase)(schema, options);\n    }\n  }]);\n}();\nexports.JsonTypeBuilder = JsonTypeBuilder;\n\n},{\"../any/index\":42,\"../array/index\":46,\"../boolean/index\":54,\"../composite/index\":59,\"../const/index\":63,\"../enum/index\":76,\"../exclude/index\":82,\"../extends/index\":88,\"../extract/index\":92,\"../indexed/index\":101,\"../integer/index\":110,\"../intersect/index\":112,\"../intrinsic/index\":118,\"../keyof/index\":126,\"../literal/index\":131,\"../mapped/index\":133,\"../module/index\":138,\"../never/index\":140,\"../not/index\":142,\"../null/index\":144,\"../number/index\":146,\"../object/index\":148,\"../omit/index\":150,\"../optional/index\":154,\"../partial/index\":159,\"../pick/index\":164,\"../readonly-optional/index\":170,\"../readonly/index\":172,\"../record/index\":175,\"../recursive/index\":177,\"../ref/index\":179,\"../required/index\":186,\"../rest/index\":189,\"../string/index\":200,\"../template-literal/index\":208,\"../transform/index\":214,\"../tuple/index\":216,\"../union/index\":226,\"../unknown/index\":231,\"../unsafe/index\":233}],221:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Rest = exports.Required = exports.RegExp = exports.Ref = exports.Recursive = exports.Record = exports.ReadonlyOptional = exports.Readonly = exports.Promise = exports.Pick = exports.Partial = exports.Parameters = exports.Optional = exports.Omit = exports.Object = exports.Number = exports.Null = exports.Not = exports.Never = exports.Module = exports.Mapped = exports.Literal = exports.KeyOf = exports.Iterator = exports.Uppercase = exports.Lowercase = exports.Uncapitalize = exports.Capitalize = exports.Intersect = exports.Integer = exports.Instantiate = exports.InstanceType = exports.Index = exports.Function = exports.Extract = exports.Extends = exports.Exclude = exports.Enum = exports.Date = exports.ConstructorParameters = exports.Constructor = exports.Const = exports.Composite = exports.Boolean = exports.BigInt = exports.Awaited = exports.AsyncIterator = exports.Array = exports.Argument = exports.Any = void 0;\nexports.Void = exports.Unsafe = exports.Unknown = exports.Union = exports.Undefined = exports.Uint8Array = exports.Tuple = exports.Transform = exports.TemplateLiteral = exports.Symbol = exports.String = exports.ReturnType = void 0;\n// ------------------------------------------------------------------\n// Type: Module\n// ------------------------------------------------------------------\nvar index_1 = require(\"../any/index\");\nObject.defineProperty(exports, \"Any\", {\n  enumerable: true,\n  get: function get() {\n    return index_1.Any;\n  }\n});\nvar index_2 = require(\"../argument/index\");\nObject.defineProperty(exports, \"Argument\", {\n  enumerable: true,\n  get: function get() {\n    return index_2.Argument;\n  }\n});\nvar index_3 = require(\"../array/index\");\nObject.defineProperty(exports, \"Array\", {\n  enumerable: true,\n  get: function get() {\n    return index_3.Array;\n  }\n});\nvar index_4 = require(\"../async-iterator/index\");\nObject.defineProperty(exports, \"AsyncIterator\", {\n  enumerable: true,\n  get: function get() {\n    return index_4.AsyncIterator;\n  }\n});\nvar index_5 = require(\"../awaited/index\");\nObject.defineProperty(exports, \"Awaited\", {\n  enumerable: true,\n  get: function get() {\n    return index_5.Awaited;\n  }\n});\nvar index_6 = require(\"../bigint/index\");\nObject.defineProperty(exports, \"BigInt\", {\n  enumerable: true,\n  get: function get() {\n    return index_6.BigInt;\n  }\n});\nvar index_7 = require(\"../boolean/index\");\nObject.defineProperty(exports, \"Boolean\", {\n  enumerable: true,\n  get: function get() {\n    return index_7.Boolean;\n  }\n});\nvar index_8 = require(\"../composite/index\");\nObject.defineProperty(exports, \"Composite\", {\n  enumerable: true,\n  get: function get() {\n    return index_8.Composite;\n  }\n});\nvar index_9 = require(\"../const/index\");\nObject.defineProperty(exports, \"Const\", {\n  enumerable: true,\n  get: function get() {\n    return index_9.Const;\n  }\n});\nvar index_10 = require(\"../constructor/index\");\nObject.defineProperty(exports, \"Constructor\", {\n  enumerable: true,\n  get: function get() {\n    return index_10.Constructor;\n  }\n});\nvar index_11 = require(\"../constructor-parameters/index\");\nObject.defineProperty(exports, \"ConstructorParameters\", {\n  enumerable: true,\n  get: function get() {\n    return index_11.ConstructorParameters;\n  }\n});\nvar index_12 = require(\"../date/index\");\nObject.defineProperty(exports, \"Date\", {\n  enumerable: true,\n  get: function get() {\n    return index_12.Date;\n  }\n});\nvar index_13 = require(\"../enum/index\");\nObject.defineProperty(exports, \"Enum\", {\n  enumerable: true,\n  get: function get() {\n    return index_13.Enum;\n  }\n});\nvar index_14 = require(\"../exclude/index\");\nObject.defineProperty(exports, \"Exclude\", {\n  enumerable: true,\n  get: function get() {\n    return index_14.Exclude;\n  }\n});\nvar index_15 = require(\"../extends/index\");\nObject.defineProperty(exports, \"Extends\", {\n  enumerable: true,\n  get: function get() {\n    return index_15.Extends;\n  }\n});\nvar index_16 = require(\"../extract/index\");\nObject.defineProperty(exports, \"Extract\", {\n  enumerable: true,\n  get: function get() {\n    return index_16.Extract;\n  }\n});\nvar index_17 = require(\"../function/index\");\nObject.defineProperty(exports, \"Function\", {\n  enumerable: true,\n  get: function get() {\n    return index_17.Function;\n  }\n});\nvar index_18 = require(\"../indexed/index\");\nObject.defineProperty(exports, \"Index\", {\n  enumerable: true,\n  get: function get() {\n    return index_18.Index;\n  }\n});\nvar index_19 = require(\"../instance-type/index\");\nObject.defineProperty(exports, \"InstanceType\", {\n  enumerable: true,\n  get: function get() {\n    return index_19.InstanceType;\n  }\n});\nvar index_20 = require(\"../instantiate/index\");\nObject.defineProperty(exports, \"Instantiate\", {\n  enumerable: true,\n  get: function get() {\n    return index_20.Instantiate;\n  }\n});\nvar index_21 = require(\"../integer/index\");\nObject.defineProperty(exports, \"Integer\", {\n  enumerable: true,\n  get: function get() {\n    return index_21.Integer;\n  }\n});\nvar index_22 = require(\"../intersect/index\");\nObject.defineProperty(exports, \"Intersect\", {\n  enumerable: true,\n  get: function get() {\n    return index_22.Intersect;\n  }\n});\nvar index_23 = require(\"../intrinsic/index\");\nObject.defineProperty(exports, \"Capitalize\", {\n  enumerable: true,\n  get: function get() {\n    return index_23.Capitalize;\n  }\n});\nObject.defineProperty(exports, \"Uncapitalize\", {\n  enumerable: true,\n  get: function get() {\n    return index_23.Uncapitalize;\n  }\n});\nObject.defineProperty(exports, \"Lowercase\", {\n  enumerable: true,\n  get: function get() {\n    return index_23.Lowercase;\n  }\n});\nObject.defineProperty(exports, \"Uppercase\", {\n  enumerable: true,\n  get: function get() {\n    return index_23.Uppercase;\n  }\n});\nvar index_24 = require(\"../iterator/index\");\nObject.defineProperty(exports, \"Iterator\", {\n  enumerable: true,\n  get: function get() {\n    return index_24.Iterator;\n  }\n});\nvar index_25 = require(\"../keyof/index\");\nObject.defineProperty(exports, \"KeyOf\", {\n  enumerable: true,\n  get: function get() {\n    return index_25.KeyOf;\n  }\n});\nvar index_26 = require(\"../literal/index\");\nObject.defineProperty(exports, \"Literal\", {\n  enumerable: true,\n  get: function get() {\n    return index_26.Literal;\n  }\n});\nvar index_27 = require(\"../mapped/index\");\nObject.defineProperty(exports, \"Mapped\", {\n  enumerable: true,\n  get: function get() {\n    return index_27.Mapped;\n  }\n});\nvar index_28 = require(\"../module/index\");\nObject.defineProperty(exports, \"Module\", {\n  enumerable: true,\n  get: function get() {\n    return index_28.Module;\n  }\n});\nvar index_29 = require(\"../never/index\");\nObject.defineProperty(exports, \"Never\", {\n  enumerable: true,\n  get: function get() {\n    return index_29.Never;\n  }\n});\nvar index_30 = require(\"../not/index\");\nObject.defineProperty(exports, \"Not\", {\n  enumerable: true,\n  get: function get() {\n    return index_30.Not;\n  }\n});\nvar index_31 = require(\"../null/index\");\nObject.defineProperty(exports, \"Null\", {\n  enumerable: true,\n  get: function get() {\n    return index_31.Null;\n  }\n});\nvar index_32 = require(\"../number/index\");\nObject.defineProperty(exports, \"Number\", {\n  enumerable: true,\n  get: function get() {\n    return index_32.Number;\n  }\n});\nvar index_33 = require(\"../object/index\");\nObject.defineProperty(exports, \"Object\", {\n  enumerable: true,\n  get: function get() {\n    return index_33.Object;\n  }\n});\nvar index_34 = require(\"../omit/index\");\nObject.defineProperty(exports, \"Omit\", {\n  enumerable: true,\n  get: function get() {\n    return index_34.Omit;\n  }\n});\nvar index_35 = require(\"../optional/index\");\nObject.defineProperty(exports, \"Optional\", {\n  enumerable: true,\n  get: function get() {\n    return index_35.Optional;\n  }\n});\nvar index_36 = require(\"../parameters/index\");\nObject.defineProperty(exports, \"Parameters\", {\n  enumerable: true,\n  get: function get() {\n    return index_36.Parameters;\n  }\n});\nvar index_37 = require(\"../partial/index\");\nObject.defineProperty(exports, \"Partial\", {\n  enumerable: true,\n  get: function get() {\n    return index_37.Partial;\n  }\n});\nvar index_38 = require(\"../pick/index\");\nObject.defineProperty(exports, \"Pick\", {\n  enumerable: true,\n  get: function get() {\n    return index_38.Pick;\n  }\n});\nvar index_39 = require(\"../promise/index\");\nObject.defineProperty(exports, \"Promise\", {\n  enumerable: true,\n  get: function get() {\n    return index_39.Promise;\n  }\n});\nvar index_40 = require(\"../readonly/index\");\nObject.defineProperty(exports, \"Readonly\", {\n  enumerable: true,\n  get: function get() {\n    return index_40.Readonly;\n  }\n});\nvar index_41 = require(\"../readonly-optional/index\");\nObject.defineProperty(exports, \"ReadonlyOptional\", {\n  enumerable: true,\n  get: function get() {\n    return index_41.ReadonlyOptional;\n  }\n});\nvar index_42 = require(\"../record/index\");\nObject.defineProperty(exports, \"Record\", {\n  enumerable: true,\n  get: function get() {\n    return index_42.Record;\n  }\n});\nvar index_43 = require(\"../recursive/index\");\nObject.defineProperty(exports, \"Recursive\", {\n  enumerable: true,\n  get: function get() {\n    return index_43.Recursive;\n  }\n});\nvar index_44 = require(\"../ref/index\");\nObject.defineProperty(exports, \"Ref\", {\n  enumerable: true,\n  get: function get() {\n    return index_44.Ref;\n  }\n});\nvar index_45 = require(\"../regexp/index\");\nObject.defineProperty(exports, \"RegExp\", {\n  enumerable: true,\n  get: function get() {\n    return index_45.RegExp;\n  }\n});\nvar index_46 = require(\"../required/index\");\nObject.defineProperty(exports, \"Required\", {\n  enumerable: true,\n  get: function get() {\n    return index_46.Required;\n  }\n});\nvar index_47 = require(\"../rest/index\");\nObject.defineProperty(exports, \"Rest\", {\n  enumerable: true,\n  get: function get() {\n    return index_47.Rest;\n  }\n});\nvar index_48 = require(\"../return-type/index\");\nObject.defineProperty(exports, \"ReturnType\", {\n  enumerable: true,\n  get: function get() {\n    return index_48.ReturnType;\n  }\n});\nvar index_49 = require(\"../string/index\");\nObject.defineProperty(exports, \"String\", {\n  enumerable: true,\n  get: function get() {\n    return index_49.String;\n  }\n});\nvar index_50 = require(\"../symbol/index\");\nObject.defineProperty(exports, \"Symbol\", {\n  enumerable: true,\n  get: function get() {\n    return index_50.Symbol;\n  }\n});\nvar index_51 = require(\"../template-literal/index\");\nObject.defineProperty(exports, \"TemplateLiteral\", {\n  enumerable: true,\n  get: function get() {\n    return index_51.TemplateLiteral;\n  }\n});\nvar index_52 = require(\"../transform/index\");\nObject.defineProperty(exports, \"Transform\", {\n  enumerable: true,\n  get: function get() {\n    return index_52.Transform;\n  }\n});\nvar index_53 = require(\"../tuple/index\");\nObject.defineProperty(exports, \"Tuple\", {\n  enumerable: true,\n  get: function get() {\n    return index_53.Tuple;\n  }\n});\nvar index_54 = require(\"../uint8array/index\");\nObject.defineProperty(exports, \"Uint8Array\", {\n  enumerable: true,\n  get: function get() {\n    return index_54.Uint8Array;\n  }\n});\nvar index_55 = require(\"../undefined/index\");\nObject.defineProperty(exports, \"Undefined\", {\n  enumerable: true,\n  get: function get() {\n    return index_55.Undefined;\n  }\n});\nvar index_56 = require(\"../union/index\");\nObject.defineProperty(exports, \"Union\", {\n  enumerable: true,\n  get: function get() {\n    return index_56.Union;\n  }\n});\nvar index_57 = require(\"../unknown/index\");\nObject.defineProperty(exports, \"Unknown\", {\n  enumerable: true,\n  get: function get() {\n    return index_57.Unknown;\n  }\n});\nvar index_58 = require(\"../unsafe/index\");\nObject.defineProperty(exports, \"Unsafe\", {\n  enumerable: true,\n  get: function get() {\n    return index_58.Unsafe;\n  }\n});\nvar index_59 = require(\"../void/index\");\nObject.defineProperty(exports, \"Void\", {\n  enumerable: true,\n  get: function get() {\n    return index_59.Void;\n  }\n});\n\n},{\"../any/index\":42,\"../argument/index\":44,\"../array/index\":46,\"../async-iterator/index\":48,\"../awaited/index\":50,\"../bigint/index\":52,\"../boolean/index\":54,\"../composite/index\":59,\"../const/index\":63,\"../constructor-parameters/index\":65,\"../constructor/index\":67,\"../date/index\":72,\"../enum/index\":76,\"../exclude/index\":82,\"../extends/index\":88,\"../extract/index\":92,\"../function/index\":94,\"../indexed/index\":101,\"../instance-type/index\":106,\"../instantiate/index\":108,\"../integer/index\":110,\"../intersect/index\":112,\"../intrinsic/index\":118,\"../iterator/index\":124,\"../keyof/index\":126,\"../literal/index\":131,\"../mapped/index\":133,\"../module/index\":138,\"../never/index\":140,\"../not/index\":142,\"../null/index\":144,\"../number/index\":146,\"../object/index\":148,\"../omit/index\":150,\"../optional/index\":154,\"../parameters/index\":157,\"../partial/index\":159,\"../pick/index\":164,\"../promise/index\":168,\"../readonly-optional/index\":170,\"../readonly/index\":172,\"../record/index\":175,\"../recursive/index\":177,\"../ref/index\":179,\"../regexp/index\":181,\"../required/index\":186,\"../rest/index\":189,\"../return-type/index\":191,\"../string/index\":200,\"../symbol/index\":202,\"../template-literal/index\":208,\"../transform/index\":214,\"../tuple/index\":216,\"../uint8array/index\":222,\"../undefined/index\":224,\"../union/index\":226,\"../unknown/index\":231,\"../unsafe/index\":233,\"../void/index\":235}],222:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./uint8array\"), exports);\n\n},{\"./uint8array\":223}],223:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Uint8Array = Uint8Array;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[JavaScript]` Creates a Uint8Array type */\nfunction Uint8Array(options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty({}, index_1.Kind, 'Uint8Array'), \"type\", 'Uint8Array'), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],224:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./undefined\"), exports);\n\n},{\"./undefined\":225}],225:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Undefined = Undefined;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[JavaScript]` Creates a Undefined type */\nfunction Undefined(options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty({}, index_1.Kind, 'Undefined'), \"type\", 'undefined'), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],226:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./union-evaluated\"), exports);\n__exportStar(require(\"./union-type\"), exports);\n__exportStar(require(\"./union\"), exports);\n\n},{\"./union\":230,\"./union-evaluated\":228,\"./union-type\":229}],227:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.UnionCreate = UnionCreate;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\nfunction UnionCreate(T, options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty({}, index_1.Kind, 'Union'), \"anyOf\", T), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],228:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.UnionEvaluated = UnionEvaluated;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\nvar index_2 = require(\"../discard/index\");\nvar index_3 = require(\"../never/index\");\nvar index_4 = require(\"../optional/index\");\nvar union_create_1 = require(\"./union-create\");\n// ------------------------------------------------------------------\n// TypeGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../guard/kind\");\n// prettier-ignore\nfunction IsUnionOptional(types) {\n  return types.some(function (type) {\n    return (0, kind_1.IsOptional)(type);\n  });\n}\n// prettier-ignore\nfunction RemoveOptionalFromRest(types) {\n  return types.map(function (left) {\n    return (0, kind_1.IsOptional)(left) ? RemoveOptionalFromType(left) : left;\n  });\n}\n// prettier-ignore\nfunction RemoveOptionalFromType(T) {\n  return (0, index_2.Discard)(T, [index_1.OptionalKind]);\n}\n// prettier-ignore\nfunction ResolveUnion(types, options) {\n  var isOptional = IsUnionOptional(types);\n  return isOptional ? (0, index_4.Optional)((0, union_create_1.UnionCreate)(RemoveOptionalFromRest(types), options)) : (0, union_create_1.UnionCreate)(RemoveOptionalFromRest(types), options);\n}\n/** `[Json]` Creates an evaluated Union type */\nfunction UnionEvaluated(T, options) {\n  // prettier-ignore\n  return T.length === 1 ? (0, type_1.CreateType)(T[0], options) : T.length === 0 ? (0, index_3.Never)(options) : ResolveUnion(T, options);\n}\n\n},{\"../create/type\":70,\"../discard/index\":74,\"../guard/kind\":96,\"../never/index\":140,\"../optional/index\":154,\"../symbols/index\":204,\"./union-create\":227}],229:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nvar index_1 = require(\"../symbols/index\");\n\n},{\"../symbols/index\":204}],230:[function(require,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Union = Union;\nvar index_1 = require(\"../never/index\");\nvar type_1 = require(\"../create/type\");\nvar union_create_1 = require(\"./union-create\");\n/** `[Json]` Creates a Union type */\nfunction Union(types, options) {\n  // prettier-ignore\n  return types.length === 0 ? (0, index_1.Never)(options) : types.length === 1 ? (0, type_1.CreateType)(types[0], options) : (0, union_create_1.UnionCreate)(types, options);\n}\n\n},{\"../create/type\":70,\"../never/index\":140,\"./union-create\":227}],231:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./unknown\"), exports);\n\n},{\"./unknown\":232}],232:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Unknown = Unknown;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[Json]` Creates an Unknown type */\nfunction Unknown(options) {\n  return (0, type_1.CreateType)(_defineProperty({}, index_1.Kind, 'Unknown'), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],233:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./unsafe\"), exports);\n\n},{\"./unsafe\":234}],234:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Unsafe = Unsafe;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[Json]` Creates a Unsafe type that will infers as the generic argument T */\nfunction Unsafe() {\n  var _options$index_1$Kind;\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  return (0, type_1.CreateType)(_defineProperty({}, index_1.Kind, (_options$index_1$Kind = options[index_1.Kind]) !== null && _options$index_1$Kind !== void 0 ? _options$index_1$Kind : 'Unsafe'), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],235:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./void\"), exports);\n\n},{\"./void\":236}],236:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Void = Void;\nvar type_1 = require(\"../create/type\");\nvar index_1 = require(\"../symbols/index\");\n/** `[JavaScript]` Creates a Void type */\nfunction Void(options) {\n  return (0, type_1.CreateType)(_defineProperty(_defineProperty({}, index_1.Kind, 'Void'), \"type\", 'void'), options);\n}\n\n},{\"../create/type\":70,\"../symbols/index\":204}],237:[function(require,module,exports){\n\"use strict\";\n\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ValueCheckUnknownTypeError = void 0;\nexports.Check = Check;\nvar index_1 = require(\"../../system/index\");\nvar index_2 = require(\"../deref/index\");\nvar index_3 = require(\"../hash/index\");\nvar index_4 = require(\"../../type/symbols/index\");\nvar index_5 = require(\"../../type/keyof/index\");\nvar index_6 = require(\"../../type/extends/index\");\nvar index_7 = require(\"../../type/registry/index\");\nvar index_8 = require(\"../../type/error/index\");\nvar index_9 = require(\"../../type/never/index\");\n// ------------------------------------------------------------------\n// ValueGuard\n// ------------------------------------------------------------------\nvar index_10 = require(\"../guard/index\");\n// ------------------------------------------------------------------\n// KindGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../../type/guard/kind\");\n// ------------------------------------------------------------------\n// Errors\n// ------------------------------------------------------------------\nvar ValueCheckUnknownTypeError = /*#__PURE__*/function (_index_8$TypeBoxError) {\n  function ValueCheckUnknownTypeError(schema) {\n    var _this;\n    _classCallCheck(this, ValueCheckUnknownTypeError);\n    _this = _callSuper(this, ValueCheckUnknownTypeError, [\"Unknown type\"]);\n    _this.schema = schema;\n    return _this;\n  }\n  _inherits(ValueCheckUnknownTypeError, _index_8$TypeBoxError);\n  return _createClass(ValueCheckUnknownTypeError);\n}(index_8.TypeBoxError);\nexports.ValueCheckUnknownTypeError = ValueCheckUnknownTypeError;\n// ------------------------------------------------------------------\n// TypeGuards\n// ------------------------------------------------------------------\nfunction IsAnyOrUnknown(schema) {\n  return schema[index_4.Kind] === 'Any' || schema[index_4.Kind] === 'Unknown';\n}\n// ------------------------------------------------------------------\n// Guards\n// ------------------------------------------------------------------\nfunction IsDefined(value) {\n  return value !== undefined;\n}\n// ------------------------------------------------------------------\n// Types\n// ------------------------------------------------------------------\nfunction FromAny(schema, references, value) {\n  return true;\n}\nfunction FromArgument(schema, references, value) {\n  return true;\n}\nfunction FromArray(schema, references, value) {\n  if (!(0, index_10.IsArray)(value)) return false;\n  if (IsDefined(schema.minItems) && !(value.length >= schema.minItems)) {\n    return false;\n  }\n  if (IsDefined(schema.maxItems) && !(value.length <= schema.maxItems)) {\n    return false;\n  }\n  if (!value.every(function (value) {\n    return Visit(schema.items, references, value);\n  })) {\n    return false;\n  }\n  // prettier-ignore\n  if (schema.uniqueItems === true && !function () {\n    var set = new Set();\n    var _iterator = _createForOfIteratorHelper(value),\n      _step;\n    try {\n      for (_iterator.s(); !(_step = _iterator.n()).done;) {\n        var element = _step.value;\n        var hashed = (0, index_3.Hash)(element);\n        if (set.has(hashed)) {\n          return false;\n        } else {\n          set.add(hashed);\n        }\n      }\n    } catch (err) {\n      _iterator.e(err);\n    } finally {\n      _iterator.f();\n    }\n    return true;\n  }()) {\n    return false;\n  }\n  // contains\n  if (!(IsDefined(schema.contains) || (0, index_10.IsNumber)(schema.minContains) || (0, index_10.IsNumber)(schema.maxContains))) {\n    return true; // exit\n  }\n  var containsSchema = IsDefined(schema.contains) ? schema.contains : (0, index_9.Never)();\n  var containsCount = value.reduce(function (acc, value) {\n    return Visit(containsSchema, references, value) ? acc + 1 : acc;\n  }, 0);\n  if (containsCount === 0) {\n    return false;\n  }\n  if ((0, index_10.IsNumber)(schema.minContains) && containsCount < schema.minContains) {\n    return false;\n  }\n  if ((0, index_10.IsNumber)(schema.maxContains) && containsCount > schema.maxContains) {\n    return false;\n  }\n  return true;\n}\nfunction FromAsyncIterator(schema, references, value) {\n  return (0, index_10.IsAsyncIterator)(value);\n}\nfunction FromBigInt(schema, references, value) {\n  if (!(0, index_10.IsBigInt)(value)) return false;\n  if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {\n    return false;\n  }\n  if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {\n    return false;\n  }\n  if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {\n    return false;\n  }\n  if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {\n    return false;\n  }\n  if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === BigInt(0))) {\n    return false;\n  }\n  return true;\n}\nfunction FromBoolean(schema, references, value) {\n  return (0, index_10.IsBoolean)(value);\n}\nfunction FromConstructor(schema, references, value) {\n  return Visit(schema.returns, references, value.prototype);\n}\nfunction FromDate(schema, references, value) {\n  if (!(0, index_10.IsDate)(value)) return false;\n  if (IsDefined(schema.exclusiveMaximumTimestamp) && !(value.getTime() < schema.exclusiveMaximumTimestamp)) {\n    return false;\n  }\n  if (IsDefined(schema.exclusiveMinimumTimestamp) && !(value.getTime() > schema.exclusiveMinimumTimestamp)) {\n    return false;\n  }\n  if (IsDefined(schema.maximumTimestamp) && !(value.getTime() <= schema.maximumTimestamp)) {\n    return false;\n  }\n  if (IsDefined(schema.minimumTimestamp) && !(value.getTime() >= schema.minimumTimestamp)) {\n    return false;\n  }\n  if (IsDefined(schema.multipleOfTimestamp) && !(value.getTime() % schema.multipleOfTimestamp === 0)) {\n    return false;\n  }\n  return true;\n}\nfunction FromFunction(schema, references, value) {\n  return (0, index_10.IsFunction)(value);\n}\nfunction FromImport(schema, references, value) {\n  var definitions = globalThis.Object.values(schema.$defs);\n  var target = schema.$defs[schema.$ref];\n  return Visit(target, [].concat(_toConsumableArray(references), _toConsumableArray(definitions)), value);\n}\nfunction FromInteger(schema, references, value) {\n  if (!(0, index_10.IsInteger)(value)) {\n    return false;\n  }\n  if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {\n    return false;\n  }\n  if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {\n    return false;\n  }\n  if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {\n    return false;\n  }\n  if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {\n    return false;\n  }\n  if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) {\n    return false;\n  }\n  return true;\n}\nfunction FromIntersect(schema, references, value) {\n  var check1 = schema.allOf.every(function (schema) {\n    return Visit(schema, references, value);\n  });\n  if (schema.unevaluatedProperties === false) {\n    var keyPattern = new RegExp((0, index_5.KeyOfPattern)(schema));\n    var check2 = Object.getOwnPropertyNames(value).every(function (key) {\n      return keyPattern.test(key);\n    });\n    return check1 && check2;\n  } else if ((0, kind_1.IsSchema)(schema.unevaluatedProperties)) {\n    var keyCheck = new RegExp((0, index_5.KeyOfPattern)(schema));\n    var _check = Object.getOwnPropertyNames(value).every(function (key) {\n      return keyCheck.test(key) || Visit(schema.unevaluatedProperties, references, value[key]);\n    });\n    return check1 && _check;\n  } else {\n    return check1;\n  }\n}\nfunction FromIterator(schema, references, value) {\n  return (0, index_10.IsIterator)(value);\n}\nfunction FromLiteral(schema, references, value) {\n  return value === schema[\"const\"];\n}\nfunction FromNever(schema, references, value) {\n  return false;\n}\nfunction FromNot(schema, references, value) {\n  return !Visit(schema.not, references, value);\n}\nfunction FromNull(schema, references, value) {\n  return (0, index_10.IsNull)(value);\n}\nfunction FromNumber(schema, references, value) {\n  if (!index_1.TypeSystemPolicy.IsNumberLike(value)) return false;\n  if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {\n    return false;\n  }\n  if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {\n    return false;\n  }\n  if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {\n    return false;\n  }\n  if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {\n    return false;\n  }\n  if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) {\n    return false;\n  }\n  return true;\n}\nfunction FromObject(schema, references, value) {\n  if (!index_1.TypeSystemPolicy.IsObjectLike(value)) return false;\n  if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) {\n    return false;\n  }\n  if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) {\n    return false;\n  }\n  var knownKeys = Object.getOwnPropertyNames(schema.properties);\n  var _iterator2 = _createForOfIteratorHelper(knownKeys),\n    _step2;\n  try {\n    for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n      var knownKey = _step2.value;\n      var property = schema.properties[knownKey];\n      if (schema.required && schema.required.includes(knownKey)) {\n        if (!Visit(property, references, value[knownKey])) {\n          return false;\n        }\n        if (((0, index_6.ExtendsUndefinedCheck)(property) || IsAnyOrUnknown(property)) && !(knownKey in value)) {\n          return false;\n        }\n      } else {\n        if (index_1.TypeSystemPolicy.IsExactOptionalProperty(value, knownKey) && !Visit(property, references, value[knownKey])) {\n          return false;\n        }\n      }\n    }\n  } catch (err) {\n    _iterator2.e(err);\n  } finally {\n    _iterator2.f();\n  }\n  if (schema.additionalProperties === false) {\n    var valueKeys = Object.getOwnPropertyNames(value);\n    // optimization: value is valid if schemaKey length matches the valueKey length\n    if (schema.required && schema.required.length === knownKeys.length && valueKeys.length === knownKeys.length) {\n      return true;\n    } else {\n      return valueKeys.every(function (valueKey) {\n        return knownKeys.includes(valueKey);\n      });\n    }\n  } else if (_typeof(schema.additionalProperties) === 'object') {\n    var _valueKeys = Object.getOwnPropertyNames(value);\n    return _valueKeys.every(function (key) {\n      return knownKeys.includes(key) || Visit(schema.additionalProperties, references, value[key]);\n    });\n  } else {\n    return true;\n  }\n}\nfunction FromPromise(schema, references, value) {\n  return (0, index_10.IsPromise)(value);\n}\nfunction FromRecord(schema, references, value) {\n  if (!index_1.TypeSystemPolicy.IsRecordLike(value)) {\n    return false;\n  }\n  if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) {\n    return false;\n  }\n  if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) {\n    return false;\n  }\n  var _Object$entries$ = _slicedToArray(Object.entries(schema.patternProperties)[0], 2),\n    patternKey = _Object$entries$[0],\n    patternSchema = _Object$entries$[1];\n  var regex = new RegExp(patternKey);\n  // prettier-ignore\n  var check1 = Object.entries(value).every(function (_ref) {\n    var _ref2 = _slicedToArray(_ref, 2),\n      key = _ref2[0],\n      value = _ref2[1];\n    return regex.test(key) ? Visit(patternSchema, references, value) : true;\n  });\n  // prettier-ignore\n  var check2 = _typeof(schema.additionalProperties) === 'object' ? Object.entries(value).every(function (_ref3) {\n    var _ref4 = _slicedToArray(_ref3, 2),\n      key = _ref4[0],\n      value = _ref4[1];\n    return !regex.test(key) ? Visit(schema.additionalProperties, references, value) : true;\n  }) : true;\n  var check3 = schema.additionalProperties === false ? Object.getOwnPropertyNames(value).every(function (key) {\n    return regex.test(key);\n  }) : true;\n  return check1 && check2 && check3;\n}\nfunction FromRef(schema, references, value) {\n  return Visit((0, index_2.Deref)(schema, references), references, value);\n}\nfunction FromRegExp(schema, references, value) {\n  var regex = new RegExp(schema.source, schema.flags);\n  if (IsDefined(schema.minLength)) {\n    if (!(value.length >= schema.minLength)) return false;\n  }\n  if (IsDefined(schema.maxLength)) {\n    if (!(value.length <= schema.maxLength)) return false;\n  }\n  return regex.test(value);\n}\nfunction FromString(schema, references, value) {\n  if (!(0, index_10.IsString)(value)) {\n    return false;\n  }\n  if (IsDefined(schema.minLength)) {\n    if (!(value.length >= schema.minLength)) return false;\n  }\n  if (IsDefined(schema.maxLength)) {\n    if (!(value.length <= schema.maxLength)) return false;\n  }\n  if (IsDefined(schema.pattern)) {\n    var regex = new RegExp(schema.pattern);\n    if (!regex.test(value)) return false;\n  }\n  if (IsDefined(schema.format)) {\n    if (!index_7.FormatRegistry.Has(schema.format)) return false;\n    var func = index_7.FormatRegistry.Get(schema.format);\n    return func(value);\n  }\n  return true;\n}\nfunction FromSymbol(schema, references, value) {\n  return (0, index_10.IsSymbol)(value);\n}\nfunction FromTemplateLiteral(schema, references, value) {\n  return (0, index_10.IsString)(value) && new RegExp(schema.pattern).test(value);\n}\nfunction FromThis(schema, references, value) {\n  return Visit((0, index_2.Deref)(schema, references), references, value);\n}\nfunction FromTuple(schema, references, value) {\n  if (!(0, index_10.IsArray)(value)) {\n    return false;\n  }\n  if (schema.items === undefined && !(value.length === 0)) {\n    return false;\n  }\n  if (!(value.length === schema.maxItems)) {\n    return false;\n  }\n  if (!schema.items) {\n    return true;\n  }\n  for (var i = 0; i < schema.items.length; i++) {\n    if (!Visit(schema.items[i], references, value[i])) return false;\n  }\n  return true;\n}\nfunction FromUndefined(schema, references, value) {\n  return (0, index_10.IsUndefined)(value);\n}\nfunction FromUnion(schema, references, value) {\n  return schema.anyOf.some(function (inner) {\n    return Visit(inner, references, value);\n  });\n}\nfunction FromUint8Array(schema, references, value) {\n  if (!(0, index_10.IsUint8Array)(value)) {\n    return false;\n  }\n  if (IsDefined(schema.maxByteLength) && !(value.length <= schema.maxByteLength)) {\n    return false;\n  }\n  if (IsDefined(schema.minByteLength) && !(value.length >= schema.minByteLength)) {\n    return false;\n  }\n  return true;\n}\nfunction FromUnknown(schema, references, value) {\n  return true;\n}\nfunction FromVoid(schema, references, value) {\n  return index_1.TypeSystemPolicy.IsVoidLike(value);\n}\nfunction FromKind(schema, references, value) {\n  if (!index_7.TypeRegistry.Has(schema[index_4.Kind])) return false;\n  var func = index_7.TypeRegistry.Get(schema[index_4.Kind]);\n  return func(schema, value);\n}\nfunction Visit(schema, references, value) {\n  var references_ = IsDefined(schema.$id) ? (0, index_2.Pushref)(schema, references) : references;\n  var schema_ = schema;\n  switch (schema_[index_4.Kind]) {\n    case 'Any':\n      return FromAny(schema_, references_, value);\n    case 'Argument':\n      return FromArgument(schema_, references_, value);\n    case 'Array':\n      return FromArray(schema_, references_, value);\n    case 'AsyncIterator':\n      return FromAsyncIterator(schema_, references_, value);\n    case 'BigInt':\n      return FromBigInt(schema_, references_, value);\n    case 'Boolean':\n      return FromBoolean(schema_, references_, value);\n    case 'Constructor':\n      return FromConstructor(schema_, references_, value);\n    case 'Date':\n      return FromDate(schema_, references_, value);\n    case 'Function':\n      return FromFunction(schema_, references_, value);\n    case 'Import':\n      return FromImport(schema_, references_, value);\n    case 'Integer':\n      return FromInteger(schema_, references_, value);\n    case 'Intersect':\n      return FromIntersect(schema_, references_, value);\n    case 'Iterator':\n      return FromIterator(schema_, references_, value);\n    case 'Literal':\n      return FromLiteral(schema_, references_, value);\n    case 'Never':\n      return FromNever(schema_, references_, value);\n    case 'Not':\n      return FromNot(schema_, references_, value);\n    case 'Null':\n      return FromNull(schema_, references_, value);\n    case 'Number':\n      return FromNumber(schema_, references_, value);\n    case 'Object':\n      return FromObject(schema_, references_, value);\n    case 'Promise':\n      return FromPromise(schema_, references_, value);\n    case 'Record':\n      return FromRecord(schema_, references_, value);\n    case 'Ref':\n      return FromRef(schema_, references_, value);\n    case 'RegExp':\n      return FromRegExp(schema_, references_, value);\n    case 'String':\n      return FromString(schema_, references_, value);\n    case 'Symbol':\n      return FromSymbol(schema_, references_, value);\n    case 'TemplateLiteral':\n      return FromTemplateLiteral(schema_, references_, value);\n    case 'This':\n      return FromThis(schema_, references_, value);\n    case 'Tuple':\n      return FromTuple(schema_, references_, value);\n    case 'Undefined':\n      return FromUndefined(schema_, references_, value);\n    case 'Union':\n      return FromUnion(schema_, references_, value);\n    case 'Uint8Array':\n      return FromUint8Array(schema_, references_, value);\n    case 'Unknown':\n      return FromUnknown(schema_, references_, value);\n    case 'Void':\n      return FromVoid(schema_, references_, value);\n    default:\n      if (!index_7.TypeRegistry.Has(schema_[index_4.Kind])) throw new ValueCheckUnknownTypeError(schema_);\n      return FromKind(schema_, references_, value);\n  }\n}\n/** Returns true if the value matches the given type. */\nfunction Check() {\n  return arguments.length === 3 ? Visit(arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1], arguments.length <= 2 ? undefined : arguments[2]) : Visit(arguments.length <= 0 ? undefined : arguments[0], [], arguments.length <= 1 ? undefined : arguments[1]);\n}\n\n},{\"../../system/index\":38,\"../../type/error/index\":78,\"../../type/extends/index\":88,\"../../type/guard/kind\":96,\"../../type/keyof/index\":126,\"../../type/never/index\":140,\"../../type/registry/index\":184,\"../../type/symbols/index\":204,\"../deref/index\":240,\"../guard/index\":242,\"../hash/index\":244}],238:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./check\"), exports);\n\n},{\"./check\":237}],239:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TypeDereferenceError = void 0;\nexports.Pushref = Pushref;\nexports.Deref = Deref;\nvar index_1 = require(\"../../type/error/index\");\nvar index_2 = require(\"../../type/symbols/index\");\nvar guard_1 = require(\"../guard/guard\");\nvar TypeDereferenceError = /*#__PURE__*/function (_index_1$TypeBoxError) {\n  function TypeDereferenceError(schema) {\n    var _this;\n    _classCallCheck(this, TypeDereferenceError);\n    _this = _callSuper(this, TypeDereferenceError, [\"Unable to dereference schema with $id '\".concat(schema.$ref, \"'\")]);\n    _this.schema = schema;\n    return _this;\n  }\n  _inherits(TypeDereferenceError, _index_1$TypeBoxError);\n  return _createClass(TypeDereferenceError);\n}(index_1.TypeBoxError);\nexports.TypeDereferenceError = TypeDereferenceError;\nfunction Resolve(schema, references) {\n  var target = references.find(function (target) {\n    return target.$id === schema.$ref;\n  });\n  if (target === undefined) throw new TypeDereferenceError(schema);\n  return Deref(target, references);\n}\n/** `[Internal]` Pushes a schema onto references if the schema has an $id and does not exist on references */\nfunction Pushref(schema, references) {\n  if (!(0, guard_1.IsString)(schema.$id) || references.some(function (target) {\n    return target.$id === schema.$id;\n  })) return references;\n  references.push(schema);\n  return references;\n}\n/** `[Internal]` Dereferences a schema from the references array or throws if not found */\nfunction Deref(schema, references) {\n  // prettier-ignore\n  return schema[index_2.Kind] === 'This' || schema[index_2.Kind] === 'Ref' ? Resolve(schema, references) : schema;\n}\n\n},{\"../../type/error/index\":78,\"../../type/symbols/index\":204,\"../guard/guard\":241}],240:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./deref\"), exports);\n\n},{\"./deref\":239}],241:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.IsAsyncIterator = IsAsyncIterator;\nexports.IsIterator = IsIterator;\nexports.IsStandardObject = IsStandardObject;\nexports.IsInstanceObject = IsInstanceObject;\nexports.IsPromise = IsPromise;\nexports.IsDate = IsDate;\nexports.IsMap = IsMap;\nexports.IsSet = IsSet;\nexports.IsRegExp = IsRegExp;\nexports.IsTypedArray = IsTypedArray;\nexports.IsInt8Array = IsInt8Array;\nexports.IsUint8Array = IsUint8Array;\nexports.IsUint8ClampedArray = IsUint8ClampedArray;\nexports.IsInt16Array = IsInt16Array;\nexports.IsUint16Array = IsUint16Array;\nexports.IsInt32Array = IsInt32Array;\nexports.IsUint32Array = IsUint32Array;\nexports.IsFloat32Array = IsFloat32Array;\nexports.IsFloat64Array = IsFloat64Array;\nexports.IsBigInt64Array = IsBigInt64Array;\nexports.IsBigUint64Array = IsBigUint64Array;\nexports.HasPropertyKey = HasPropertyKey;\nexports.IsObject = IsObject;\nexports.IsArray = IsArray;\nexports.IsUndefined = IsUndefined;\nexports.IsNull = IsNull;\nexports.IsBoolean = IsBoolean;\nexports.IsNumber = IsNumber;\nexports.IsInteger = IsInteger;\nexports.IsBigInt = IsBigInt;\nexports.IsString = IsString;\nexports.IsFunction = IsFunction;\nexports.IsSymbol = IsSymbol;\nexports.IsValueType = IsValueType;\n// --------------------------------------------------------------------------\n// Iterators\n// --------------------------------------------------------------------------\n/** Returns true if this value is an async iterator */\nfunction IsAsyncIterator(value) {\n  return IsObject(value) && globalThis.Symbol.asyncIterator in value;\n}\n/** Returns true if this value is an iterator */\nfunction IsIterator(value) {\n  return IsObject(value) && globalThis.Symbol.iterator in value;\n}\n// --------------------------------------------------------------------------\n// Object Instances\n// --------------------------------------------------------------------------\n/** Returns true if this value is not an instance of a class */\nfunction IsStandardObject(value) {\n  return IsObject(value) && (globalThis.Object.getPrototypeOf(value) === Object.prototype || globalThis.Object.getPrototypeOf(value) === null);\n}\n/** Returns true if this value is an instance of a class */\nfunction IsInstanceObject(value) {\n  return IsObject(value) && !IsArray(value) && IsFunction(value.constructor) && value.constructor.name !== 'Object';\n}\n// --------------------------------------------------------------------------\n// JavaScript\n// --------------------------------------------------------------------------\n/** Returns true if this value is a Promise */\nfunction IsPromise(value) {\n  return value instanceof globalThis.Promise;\n}\n/** Returns true if this value is a Date */\nfunction IsDate(value) {\n  return value instanceof Date && globalThis.Number.isFinite(value.getTime());\n}\n/** Returns true if this value is an instance of Map<K, T> */\nfunction IsMap(value) {\n  return value instanceof globalThis.Map;\n}\n/** Returns true if this value is an instance of Set<T> */\nfunction IsSet(value) {\n  return value instanceof globalThis.Set;\n}\n/** Returns true if this value is RegExp */\nfunction IsRegExp(value) {\n  return value instanceof globalThis.RegExp;\n}\n/** Returns true if this value is a typed array */\nfunction IsTypedArray(value) {\n  return globalThis.ArrayBuffer.isView(value);\n}\n/** Returns true if the value is a Int8Array */\nfunction IsInt8Array(value) {\n  return value instanceof globalThis.Int8Array;\n}\n/** Returns true if the value is a Uint8Array */\nfunction IsUint8Array(value) {\n  return value instanceof globalThis.Uint8Array;\n}\n/** Returns true if the value is a Uint8ClampedArray */\nfunction IsUint8ClampedArray(value) {\n  return value instanceof globalThis.Uint8ClampedArray;\n}\n/** Returns true if the value is a Int16Array */\nfunction IsInt16Array(value) {\n  return value instanceof globalThis.Int16Array;\n}\n/** Returns true if the value is a Uint16Array */\nfunction IsUint16Array(value) {\n  return value instanceof globalThis.Uint16Array;\n}\n/** Returns true if the value is a Int32Array */\nfunction IsInt32Array(value) {\n  return value instanceof globalThis.Int32Array;\n}\n/** Returns true if the value is a Uint32Array */\nfunction IsUint32Array(value) {\n  return value instanceof globalThis.Uint32Array;\n}\n/** Returns true if the value is a Float32Array */\nfunction IsFloat32Array(value) {\n  return value instanceof globalThis.Float32Array;\n}\n/** Returns true if the value is a Float64Array */\nfunction IsFloat64Array(value) {\n  return value instanceof globalThis.Float64Array;\n}\n/** Returns true if the value is a BigInt64Array */\nfunction IsBigInt64Array(value) {\n  return value instanceof globalThis.BigInt64Array;\n}\n/** Returns true if the value is a BigUint64Array */\nfunction IsBigUint64Array(value) {\n  return value instanceof globalThis.BigUint64Array;\n}\n// --------------------------------------------------------------------------\n// PropertyKey\n// --------------------------------------------------------------------------\n/** Returns true if this value has this property key */\nfunction HasPropertyKey(value, key) {\n  return key in value;\n}\n// --------------------------------------------------------------------------\n// Standard\n// --------------------------------------------------------------------------\n/** Returns true of this value is an object type */\nfunction IsObject(value) {\n  return value !== null && _typeof(value) === 'object';\n}\n/** Returns true if this value is an array, but not a typed array */\nfunction IsArray(value) {\n  return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value);\n}\n/** Returns true if this value is an undefined */\nfunction IsUndefined(value) {\n  return value === undefined;\n}\n/** Returns true if this value is an null */\nfunction IsNull(value) {\n  return value === null;\n}\n/** Returns true if this value is an boolean */\nfunction IsBoolean(value) {\n  return typeof value === 'boolean';\n}\n/** Returns true if this value is an number */\nfunction IsNumber(value) {\n  return typeof value === 'number';\n}\n/** Returns true if this value is an integer */\nfunction IsInteger(value) {\n  return globalThis.Number.isInteger(value);\n}\n/** Returns true if this value is bigint */\nfunction IsBigInt(value) {\n  return typeof value === 'bigint';\n}\n/** Returns true if this value is string */\nfunction IsString(value) {\n  return typeof value === 'string';\n}\n/** Returns true if this value is a function */\nfunction IsFunction(value) {\n  return typeof value === 'function';\n}\n/** Returns true if this value is a symbol */\nfunction IsSymbol(value) {\n  return _typeof(value) === 'symbol';\n}\n/** Returns true if this value is a value type such as number, string, boolean */\nfunction IsValueType(value) {\n  // prettier-ignore\n  return IsBigInt(value) || IsBoolean(value) || IsNull(value) || IsNumber(value) || IsString(value) || IsSymbol(value) || IsUndefined(value);\n}\n\n},{}],242:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./guard\"), exports);\n\n},{\"./guard\":241}],243:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nvar _marked = /*#__PURE__*/_regeneratorRuntime().mark(NumberToBytes);\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.ValueHashError = void 0;\nexports.Hash = Hash;\nvar index_1 = require(\"../guard/index\");\nvar index_2 = require(\"../../type/error/index\");\n// ------------------------------------------------------------------\n// Errors\n// ------------------------------------------------------------------\nvar ValueHashError = /*#__PURE__*/function (_index_2$TypeBoxError) {\n  function ValueHashError(value) {\n    var _this;\n    _classCallCheck(this, ValueHashError);\n    _this = _callSuper(this, ValueHashError, [\"Unable to hash value\"]);\n    _this.value = value;\n    return _this;\n  }\n  _inherits(ValueHashError, _index_2$TypeBoxError);\n  return _createClass(ValueHashError);\n}(index_2.TypeBoxError);\nexports.ValueHashError = ValueHashError;\n// ------------------------------------------------------------------\n// ByteMarker\n// ------------------------------------------------------------------\nvar ByteMarker;\n(function (ByteMarker) {\n  ByteMarker[ByteMarker[\"Undefined\"] = 0] = \"Undefined\";\n  ByteMarker[ByteMarker[\"Null\"] = 1] = \"Null\";\n  ByteMarker[ByteMarker[\"Boolean\"] = 2] = \"Boolean\";\n  ByteMarker[ByteMarker[\"Number\"] = 3] = \"Number\";\n  ByteMarker[ByteMarker[\"String\"] = 4] = \"String\";\n  ByteMarker[ByteMarker[\"Object\"] = 5] = \"Object\";\n  ByteMarker[ByteMarker[\"Array\"] = 6] = \"Array\";\n  ByteMarker[ByteMarker[\"Date\"] = 7] = \"Date\";\n  ByteMarker[ByteMarker[\"Uint8Array\"] = 8] = \"Uint8Array\";\n  ByteMarker[ByteMarker[\"Symbol\"] = 9] = \"Symbol\";\n  ByteMarker[ByteMarker[\"BigInt\"] = 10] = \"BigInt\";\n})(ByteMarker || (ByteMarker = {}));\n// ------------------------------------------------------------------\n// State\n// ------------------------------------------------------------------\nvar Accumulator = BigInt('14695981039346656037');\nvar _ref = [BigInt('1099511628211'), BigInt('18446744073709551616' /* 2 ^ 64 */)],\n  Prime = _ref[0],\n  Size = _ref[1];\nvar Bytes = Array.from({\n  length: 256\n}).map(function (_, i) {\n  return BigInt(i);\n});\nvar F64 = new Float64Array(1);\nvar F64In = new DataView(F64.buffer);\nvar F64Out = new Uint8Array(F64.buffer);\n// ------------------------------------------------------------------\n// NumberToBytes\n// ------------------------------------------------------------------\nfunction NumberToBytes(value) {\n  var byteCount, i;\n  return _regeneratorRuntime().wrap(function NumberToBytes$(_context) {\n    while (1) switch (_context.prev = _context.next) {\n      case 0:\n        byteCount = value === 0 ? 1 : Math.ceil(Math.floor(Math.log2(value) + 1) / 8);\n        i = 0;\n      case 2:\n        if (!(i < byteCount)) {\n          _context.next = 8;\n          break;\n        }\n        _context.next = 5;\n        return value >> 8 * (byteCount - 1 - i) & 0xff;\n      case 5:\n        i++;\n        _context.next = 2;\n        break;\n      case 8:\n      case \"end\":\n        return _context.stop();\n    }\n  }, _marked);\n}\n// ------------------------------------------------------------------\n// Hashing Functions\n// ------------------------------------------------------------------\nfunction ArrayType(value) {\n  FNV1A64(ByteMarker.Array);\n  var _iterator = _createForOfIteratorHelper(value),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var item = _step.value;\n      Visit(item);\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n}\nfunction BooleanType(value) {\n  FNV1A64(ByteMarker.Boolean);\n  FNV1A64(value ? 1 : 0);\n}\nfunction BigIntType(value) {\n  FNV1A64(ByteMarker.BigInt);\n  F64In.setBigInt64(0, value);\n  var _iterator2 = _createForOfIteratorHelper(F64Out),\n    _step2;\n  try {\n    for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n      var _byte = _step2.value;\n      FNV1A64(_byte);\n    }\n  } catch (err) {\n    _iterator2.e(err);\n  } finally {\n    _iterator2.f();\n  }\n}\nfunction DateType(value) {\n  FNV1A64(ByteMarker.Date);\n  Visit(value.getTime());\n}\nfunction NullType(value) {\n  FNV1A64(ByteMarker.Null);\n}\nfunction NumberType(value) {\n  FNV1A64(ByteMarker.Number);\n  F64In.setFloat64(0, value);\n  var _iterator3 = _createForOfIteratorHelper(F64Out),\n    _step3;\n  try {\n    for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n      var _byte2 = _step3.value;\n      FNV1A64(_byte2);\n    }\n  } catch (err) {\n    _iterator3.e(err);\n  } finally {\n    _iterator3.f();\n  }\n}\nfunction ObjectType(value) {\n  FNV1A64(ByteMarker.Object);\n  var _iterator4 = _createForOfIteratorHelper(globalThis.Object.getOwnPropertyNames(value).sort()),\n    _step4;\n  try {\n    for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n      var key = _step4.value;\n      Visit(key);\n      Visit(value[key]);\n    }\n  } catch (err) {\n    _iterator4.e(err);\n  } finally {\n    _iterator4.f();\n  }\n}\nfunction StringType(value) {\n  FNV1A64(ByteMarker.String);\n  for (var i = 0; i < value.length; i++) {\n    var _iterator5 = _createForOfIteratorHelper(NumberToBytes(value.charCodeAt(i))),\n      _step5;\n    try {\n      for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n        var _byte3 = _step5.value;\n        FNV1A64(_byte3);\n      }\n    } catch (err) {\n      _iterator5.e(err);\n    } finally {\n      _iterator5.f();\n    }\n  }\n}\nfunction SymbolType(value) {\n  FNV1A64(ByteMarker.Symbol);\n  Visit(value.description);\n}\nfunction Uint8ArrayType(value) {\n  FNV1A64(ByteMarker.Uint8Array);\n  for (var i = 0; i < value.length; i++) {\n    FNV1A64(value[i]);\n  }\n}\nfunction UndefinedType(value) {\n  return FNV1A64(ByteMarker.Undefined);\n}\nfunction Visit(value) {\n  if ((0, index_1.IsArray)(value)) return ArrayType(value);\n  if ((0, index_1.IsBoolean)(value)) return BooleanType(value);\n  if ((0, index_1.IsBigInt)(value)) return BigIntType(value);\n  if ((0, index_1.IsDate)(value)) return DateType(value);\n  if ((0, index_1.IsNull)(value)) return NullType(value);\n  if ((0, index_1.IsNumber)(value)) return NumberType(value);\n  if ((0, index_1.IsObject)(value)) return ObjectType(value);\n  if ((0, index_1.IsString)(value)) return StringType(value);\n  if ((0, index_1.IsSymbol)(value)) return SymbolType(value);\n  if ((0, index_1.IsUint8Array)(value)) return Uint8ArrayType(value);\n  if ((0, index_1.IsUndefined)(value)) return UndefinedType(value);\n  throw new ValueHashError(value);\n}\nfunction FNV1A64(_byte4) {\n  Accumulator = Accumulator ^ Bytes[_byte4];\n  Accumulator = Accumulator * Prime % Size;\n}\n// ------------------------------------------------------------------\n// Hash\n// ------------------------------------------------------------------\n/** Creates a FNV1A-64 non cryptographic hash of the given value */\nfunction Hash(value) {\n  Accumulator = BigInt('14695981039346656037');\n  Visit(value);\n  return Accumulator;\n}\n\n},{\"../../type/error/index\":78,\"../guard/index\":242}],244:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./hash\"), exports);\n\n},{\"./hash\":243}],245:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TransformDecodeError = exports.TransformDecodeCheckError = void 0;\nexports.TransformDecode = TransformDecode;\nvar policy_1 = require(\"../../system/policy\");\nvar index_1 = require(\"../../type/symbols/index\");\nvar index_2 = require(\"../../type/error/index\");\nvar index_3 = require(\"../../type/keyof/index\");\nvar index_4 = require(\"../deref/index\");\nvar index_5 = require(\"../check/index\");\n// ------------------------------------------------------------------\n// ValueGuard\n// ------------------------------------------------------------------\nvar index_6 = require(\"../guard/index\");\n// ------------------------------------------------------------------\n// KindGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../../type/guard/kind\");\n// ------------------------------------------------------------------\n// Errors\n// ------------------------------------------------------------------\n// thrown externally\n// prettier-ignore\nvar TransformDecodeCheckError = /*#__PURE__*/function (_index_2$TypeBoxError) {\n  function TransformDecodeCheckError(schema, value, error) {\n    var _this;\n    _classCallCheck(this, TransformDecodeCheckError);\n    _this = _callSuper(this, TransformDecodeCheckError, [\"Unable to decode value as it does not match the expected schema\"]);\n    _this.schema = schema;\n    _this.value = value;\n    _this.error = error;\n    return _this;\n  }\n  _inherits(TransformDecodeCheckError, _index_2$TypeBoxError);\n  return _createClass(TransformDecodeCheckError);\n}(index_2.TypeBoxError);\nexports.TransformDecodeCheckError = TransformDecodeCheckError;\n// prettier-ignore\nvar TransformDecodeError = /*#__PURE__*/function (_index_2$TypeBoxError2) {\n  function TransformDecodeError(schema, path, value, error) {\n    var _this2;\n    _classCallCheck(this, TransformDecodeError);\n    _this2 = _callSuper(this, TransformDecodeError, [error instanceof Error ? error.message : 'Unknown error']);\n    _this2.schema = schema;\n    _this2.path = path;\n    _this2.value = value;\n    _this2.error = error;\n    return _this2;\n  }\n  _inherits(TransformDecodeError, _index_2$TypeBoxError2);\n  return _createClass(TransformDecodeError);\n}(index_2.TypeBoxError);\nexports.TransformDecodeError = TransformDecodeError;\n// ------------------------------------------------------------------\n// Decode\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction Default(schema, path, value) {\n  try {\n    return (0, kind_1.IsTransform)(schema) ? schema[index_1.TransformKind].Decode(value) : value;\n  } catch (error) {\n    throw new TransformDecodeError(schema, path, value, error);\n  }\n}\n// prettier-ignore\nfunction FromArray(schema, references, path, value) {\n  return (0, index_6.IsArray)(value) ? Default(schema, path, value.map(function (value, index) {\n    return Visit(schema.items, references, \"\".concat(path, \"/\").concat(index), value);\n  })) : Default(schema, path, value);\n}\n// prettier-ignore\nfunction FromIntersect(schema, references, path, value) {\n  if (!(0, index_6.IsObject)(value) || (0, index_6.IsValueType)(value)) return Default(schema, path, value);\n  var knownEntries = (0, index_3.KeyOfPropertyEntries)(schema);\n  var knownKeys = knownEntries.map(function (entry) {\n    return entry[0];\n  });\n  var knownProperties = _objectSpread({}, value);\n  var _iterator = _createForOfIteratorHelper(knownEntries),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var _step$value = _slicedToArray(_step.value, 2),\n        knownKey = _step$value[0],\n        knownSchema = _step$value[1];\n      if (knownKey in knownProperties) {\n        knownProperties[knownKey] = Visit(knownSchema, references, \"\".concat(path, \"/\").concat(knownKey), knownProperties[knownKey]);\n      }\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  if (!(0, kind_1.IsTransform)(schema.unevaluatedProperties)) {\n    return Default(schema, path, knownProperties);\n  }\n  var unknownKeys = Object.getOwnPropertyNames(knownProperties);\n  var unevaluatedProperties = schema.unevaluatedProperties;\n  var unknownProperties = _objectSpread({}, knownProperties);\n  var _iterator2 = _createForOfIteratorHelper(unknownKeys),\n    _step2;\n  try {\n    for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n      var key = _step2.value;\n      if (!knownKeys.includes(key)) {\n        unknownProperties[key] = Default(unevaluatedProperties, \"\".concat(path, \"/\").concat(key), unknownProperties[key]);\n      }\n    }\n  } catch (err) {\n    _iterator2.e(err);\n  } finally {\n    _iterator2.f();\n  }\n  return Default(schema, path, unknownProperties);\n}\n// prettier-ignore\nfunction FromImport(schema, references, path, value) {\n  var additional = globalThis.Object.values(schema.$defs);\n  var target = schema.$defs[schema.$ref];\n  var result = Visit(target, [].concat(_toConsumableArray(references), _toConsumableArray(additional)), path, value);\n  return Default(schema, path, result);\n}\nfunction FromNot(schema, references, path, value) {\n  return Default(schema, path, Visit(schema.not, references, path, value));\n}\n// prettier-ignore\nfunction FromObject(schema, references, path, value) {\n  if (!(0, index_6.IsObject)(value)) return Default(schema, path, value);\n  var knownKeys = (0, index_3.KeyOfPropertyKeys)(schema);\n  var knownProperties = _objectSpread({}, value);\n  var _iterator3 = _createForOfIteratorHelper(knownKeys),\n    _step3;\n  try {\n    for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n      var key = _step3.value;\n      if (!(0, index_6.HasPropertyKey)(knownProperties, key)) continue;\n      // if the property value is undefined, but the target is not, nor does it satisfy exact optional \n      // property policy, then we need to continue. This is a special case for optional property handling \n      // where a transforms wrapped in a optional modifiers should not run.\n      if ((0, index_6.IsUndefined)(knownProperties[key]) && (!(0, kind_1.IsUndefined)(schema.properties[key]) || policy_1.TypeSystemPolicy.IsExactOptionalProperty(knownProperties, key))) continue;\n      // decode property\n      knownProperties[key] = Visit(schema.properties[key], references, \"\".concat(path, \"/\").concat(key), knownProperties[key]);\n    }\n  } catch (err) {\n    _iterator3.e(err);\n  } finally {\n    _iterator3.f();\n  }\n  if (!(0, kind_1.IsSchema)(schema.additionalProperties)) {\n    return Default(schema, path, knownProperties);\n  }\n  var unknownKeys = Object.getOwnPropertyNames(knownProperties);\n  var additionalProperties = schema.additionalProperties;\n  var unknownProperties = _objectSpread({}, knownProperties);\n  var _iterator4 = _createForOfIteratorHelper(unknownKeys),\n    _step4;\n  try {\n    for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n      var _key = _step4.value;\n      if (!knownKeys.includes(_key)) {\n        unknownProperties[_key] = Default(additionalProperties, \"\".concat(path, \"/\").concat(_key), unknownProperties[_key]);\n      }\n    }\n  } catch (err) {\n    _iterator4.e(err);\n  } finally {\n    _iterator4.f();\n  }\n  return Default(schema, path, unknownProperties);\n}\n// prettier-ignore\nfunction FromRecord(schema, references, path, value) {\n  if (!(0, index_6.IsObject)(value)) return Default(schema, path, value);\n  var pattern = Object.getOwnPropertyNames(schema.patternProperties)[0];\n  var knownKeys = new RegExp(pattern);\n  var knownProperties = _objectSpread({}, value);\n  var _iterator5 = _createForOfIteratorHelper(Object.getOwnPropertyNames(value)),\n    _step5;\n  try {\n    for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n      var key = _step5.value;\n      if (knownKeys.test(key)) {\n        knownProperties[key] = Visit(schema.patternProperties[pattern], references, \"\".concat(path, \"/\").concat(key), knownProperties[key]);\n      }\n    }\n  } catch (err) {\n    _iterator5.e(err);\n  } finally {\n    _iterator5.f();\n  }\n  if (!(0, kind_1.IsSchema)(schema.additionalProperties)) {\n    return Default(schema, path, knownProperties);\n  }\n  var unknownKeys = Object.getOwnPropertyNames(knownProperties);\n  var additionalProperties = schema.additionalProperties;\n  var unknownProperties = _objectSpread({}, knownProperties);\n  var _iterator6 = _createForOfIteratorHelper(unknownKeys),\n    _step6;\n  try {\n    for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n      var _key2 = _step6.value;\n      if (!knownKeys.test(_key2)) {\n        unknownProperties[_key2] = Default(additionalProperties, \"\".concat(path, \"/\").concat(_key2), unknownProperties[_key2]);\n      }\n    }\n  } catch (err) {\n    _iterator6.e(err);\n  } finally {\n    _iterator6.f();\n  }\n  return Default(schema, path, unknownProperties);\n}\n// prettier-ignore\nfunction FromRef(schema, references, path, value) {\n  var target = (0, index_4.Deref)(schema, references);\n  return Default(schema, path, Visit(target, references, path, value));\n}\n// prettier-ignore\nfunction FromThis(schema, references, path, value) {\n  var target = (0, index_4.Deref)(schema, references);\n  return Default(schema, path, Visit(target, references, path, value));\n}\n// prettier-ignore\nfunction FromTuple(schema, references, path, value) {\n  return (0, index_6.IsArray)(value) && (0, index_6.IsArray)(schema.items) ? Default(schema, path, schema.items.map(function (schema, index) {\n    return Visit(schema, references, \"\".concat(path, \"/\").concat(index), value[index]);\n  })) : Default(schema, path, value);\n}\n// prettier-ignore\nfunction FromUnion(schema, references, path, value) {\n  var _iterator7 = _createForOfIteratorHelper(schema.anyOf),\n    _step7;\n  try {\n    for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n      var subschema = _step7.value;\n      if (!(0, index_5.Check)(subschema, references, value)) continue;\n      // note: ensure interior is decoded first\n      var decoded = Visit(subschema, references, path, value);\n      return Default(schema, path, decoded);\n    }\n  } catch (err) {\n    _iterator7.e(err);\n  } finally {\n    _iterator7.f();\n  }\n  return Default(schema, path, value);\n}\n// prettier-ignore\nfunction Visit(schema, references, path, value) {\n  var references_ = (0, index_4.Pushref)(schema, references);\n  var schema_ = schema;\n  switch (schema[index_1.Kind]) {\n    case 'Array':\n      return FromArray(schema_, references_, path, value);\n    case 'Import':\n      return FromImport(schema_, references_, path, value);\n    case 'Intersect':\n      return FromIntersect(schema_, references_, path, value);\n    case 'Not':\n      return FromNot(schema_, references_, path, value);\n    case 'Object':\n      return FromObject(schema_, references_, path, value);\n    case 'Record':\n      return FromRecord(schema_, references_, path, value);\n    case 'Ref':\n      return FromRef(schema_, references_, path, value);\n    case 'Symbol':\n      return Default(schema_, path, value);\n    case 'This':\n      return FromThis(schema_, references_, path, value);\n    case 'Tuple':\n      return FromTuple(schema_, references_, path, value);\n    case 'Union':\n      return FromUnion(schema_, references_, path, value);\n    default:\n      return Default(schema_, path, value);\n  }\n}\n/**\n * `[Internal]` Decodes the value and returns the result. This function requires that\n * the caller `Check` the value before use. Passing unchecked values may result in\n * undefined behavior. Refer to the `Value.Decode()` for implementation details.\n */\nfunction TransformDecode(schema, references, value) {\n  return Visit(schema, references, '', value);\n}\n\n},{\"../../system/policy\":39,\"../../type/error/index\":78,\"../../type/guard/kind\":96,\"../../type/keyof/index\":126,\"../../type/symbols/index\":204,\"../check/index\":238,\"../deref/index\":240,\"../guard/index\":242}],246:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.TransformEncodeError = exports.TransformEncodeCheckError = void 0;\nexports.TransformEncode = TransformEncode;\nvar policy_1 = require(\"../../system/policy\");\nvar index_1 = require(\"../../type/symbols/index\");\nvar index_2 = require(\"../../type/error/index\");\nvar index_3 = require(\"../../type/keyof/index\");\nvar index_4 = require(\"../deref/index\");\nvar index_5 = require(\"../check/index\");\n// ------------------------------------------------------------------\n// ValueGuard\n// ------------------------------------------------------------------\nvar index_6 = require(\"../guard/index\");\n// ------------------------------------------------------------------\n// KindGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../../type/guard/kind\");\n// ------------------------------------------------------------------\n// Errors\n// ------------------------------------------------------------------\n// prettier-ignore\nvar TransformEncodeCheckError = /*#__PURE__*/function (_index_2$TypeBoxError) {\n  function TransformEncodeCheckError(schema, value, error) {\n    var _this;\n    _classCallCheck(this, TransformEncodeCheckError);\n    _this = _callSuper(this, TransformEncodeCheckError, [\"The encoded value does not match the expected schema\"]);\n    _this.schema = schema;\n    _this.value = value;\n    _this.error = error;\n    return _this;\n  }\n  _inherits(TransformEncodeCheckError, _index_2$TypeBoxError);\n  return _createClass(TransformEncodeCheckError);\n}(index_2.TypeBoxError);\nexports.TransformEncodeCheckError = TransformEncodeCheckError;\n// prettier-ignore\nvar TransformEncodeError = /*#__PURE__*/function (_index_2$TypeBoxError2) {\n  function TransformEncodeError(schema, path, value, error) {\n    var _this2;\n    _classCallCheck(this, TransformEncodeError);\n    _this2 = _callSuper(this, TransformEncodeError, [\"\".concat(error instanceof Error ? error.message : 'Unknown error')]);\n    _this2.schema = schema;\n    _this2.path = path;\n    _this2.value = value;\n    _this2.error = error;\n    return _this2;\n  }\n  _inherits(TransformEncodeError, _index_2$TypeBoxError2);\n  return _createClass(TransformEncodeError);\n}(index_2.TypeBoxError);\nexports.TransformEncodeError = TransformEncodeError;\n// ------------------------------------------------------------------\n// Encode\n// ------------------------------------------------------------------\n// prettier-ignore\nfunction Default(schema, path, value) {\n  try {\n    return (0, kind_1.IsTransform)(schema) ? schema[index_1.TransformKind].Encode(value) : value;\n  } catch (error) {\n    throw new TransformEncodeError(schema, path, value, error);\n  }\n}\n// prettier-ignore\nfunction FromArray(schema, references, path, value) {\n  var defaulted = Default(schema, path, value);\n  return (0, index_6.IsArray)(defaulted) ? defaulted.map(function (value, index) {\n    return Visit(schema.items, references, \"\".concat(path, \"/\").concat(index), value);\n  }) : defaulted;\n}\n// prettier-ignore\nfunction FromImport(schema, references, path, value) {\n  var additional = globalThis.Object.values(schema.$defs);\n  var target = schema.$defs[schema.$ref];\n  var result = Default(schema, path, value);\n  return Visit(target, [].concat(_toConsumableArray(references), _toConsumableArray(additional)), path, result);\n}\n// prettier-ignore\nfunction FromIntersect(schema, references, path, value) {\n  var defaulted = Default(schema, path, value);\n  if (!(0, index_6.IsObject)(value) || (0, index_6.IsValueType)(value)) return defaulted;\n  var knownEntries = (0, index_3.KeyOfPropertyEntries)(schema);\n  var knownKeys = knownEntries.map(function (entry) {\n    return entry[0];\n  });\n  var knownProperties = _objectSpread({}, defaulted);\n  var _iterator = _createForOfIteratorHelper(knownEntries),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var _step$value = _slicedToArray(_step.value, 2),\n        knownKey = _step$value[0],\n        knownSchema = _step$value[1];\n      if (knownKey in knownProperties) {\n        knownProperties[knownKey] = Visit(knownSchema, references, \"\".concat(path, \"/\").concat(knownKey), knownProperties[knownKey]);\n      }\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  if (!(0, kind_1.IsTransform)(schema.unevaluatedProperties)) {\n    return knownProperties;\n  }\n  var unknownKeys = Object.getOwnPropertyNames(knownProperties);\n  var unevaluatedProperties = schema.unevaluatedProperties;\n  var properties = _objectSpread({}, knownProperties);\n  var _iterator2 = _createForOfIteratorHelper(unknownKeys),\n    _step2;\n  try {\n    for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n      var key = _step2.value;\n      if (!knownKeys.includes(key)) {\n        properties[key] = Default(unevaluatedProperties, \"\".concat(path, \"/\").concat(key), properties[key]);\n      }\n    }\n  } catch (err) {\n    _iterator2.e(err);\n  } finally {\n    _iterator2.f();\n  }\n  return properties;\n}\n// prettier-ignore\nfunction FromNot(schema, references, path, value) {\n  return Default(schema.not, path, Default(schema, path, value));\n}\n// prettier-ignore\nfunction FromObject(schema, references, path, value) {\n  var defaulted = Default(schema, path, value);\n  if (!(0, index_6.IsObject)(defaulted)) return defaulted;\n  var knownKeys = (0, index_3.KeyOfPropertyKeys)(schema);\n  var knownProperties = _objectSpread({}, defaulted);\n  var _iterator3 = _createForOfIteratorHelper(knownKeys),\n    _step3;\n  try {\n    for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n      var key = _step3.value;\n      if (!(0, index_6.HasPropertyKey)(knownProperties, key)) continue;\n      // if the property value is undefined, but the target is not, nor does it satisfy exact optional \n      // property policy, then we need to continue. This is a special case for optional property handling \n      // where a transforms wrapped in a optional modifiers should not run.\n      if ((0, index_6.IsUndefined)(knownProperties[key]) && (!(0, kind_1.IsUndefined)(schema.properties[key]) || policy_1.TypeSystemPolicy.IsExactOptionalProperty(knownProperties, key))) continue;\n      // encode property\n      knownProperties[key] = Visit(schema.properties[key], references, \"\".concat(path, \"/\").concat(key), knownProperties[key]);\n    }\n  } catch (err) {\n    _iterator3.e(err);\n  } finally {\n    _iterator3.f();\n  }\n  if (!(0, kind_1.IsSchema)(schema.additionalProperties)) {\n    return knownProperties;\n  }\n  var unknownKeys = Object.getOwnPropertyNames(knownProperties);\n  var additionalProperties = schema.additionalProperties;\n  var properties = _objectSpread({}, knownProperties);\n  var _iterator4 = _createForOfIteratorHelper(unknownKeys),\n    _step4;\n  try {\n    for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n      var _key = _step4.value;\n      if (!knownKeys.includes(_key)) {\n        properties[_key] = Default(additionalProperties, \"\".concat(path, \"/\").concat(_key), properties[_key]);\n      }\n    }\n  } catch (err) {\n    _iterator4.e(err);\n  } finally {\n    _iterator4.f();\n  }\n  return properties;\n}\n// prettier-ignore\nfunction FromRecord(schema, references, path, value) {\n  var defaulted = Default(schema, path, value);\n  if (!(0, index_6.IsObject)(value)) return defaulted;\n  var pattern = Object.getOwnPropertyNames(schema.patternProperties)[0];\n  var knownKeys = new RegExp(pattern);\n  var knownProperties = _objectSpread({}, defaulted);\n  var _iterator5 = _createForOfIteratorHelper(Object.getOwnPropertyNames(value)),\n    _step5;\n  try {\n    for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n      var key = _step5.value;\n      if (knownKeys.test(key)) {\n        knownProperties[key] = Visit(schema.patternProperties[pattern], references, \"\".concat(path, \"/\").concat(key), knownProperties[key]);\n      }\n    }\n  } catch (err) {\n    _iterator5.e(err);\n  } finally {\n    _iterator5.f();\n  }\n  if (!(0, kind_1.IsSchema)(schema.additionalProperties)) {\n    return knownProperties;\n  }\n  var unknownKeys = Object.getOwnPropertyNames(knownProperties);\n  var additionalProperties = schema.additionalProperties;\n  var properties = _objectSpread({}, knownProperties);\n  var _iterator6 = _createForOfIteratorHelper(unknownKeys),\n    _step6;\n  try {\n    for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n      var _key2 = _step6.value;\n      if (!knownKeys.test(_key2)) {\n        properties[_key2] = Default(additionalProperties, \"\".concat(path, \"/\").concat(_key2), properties[_key2]);\n      }\n    }\n  } catch (err) {\n    _iterator6.e(err);\n  } finally {\n    _iterator6.f();\n  }\n  return properties;\n}\n// prettier-ignore\nfunction FromRef(schema, references, path, value) {\n  var target = (0, index_4.Deref)(schema, references);\n  var resolved = Visit(target, references, path, value);\n  return Default(schema, path, resolved);\n}\n// prettier-ignore\nfunction FromThis(schema, references, path, value) {\n  var target = (0, index_4.Deref)(schema, references);\n  var resolved = Visit(target, references, path, value);\n  return Default(schema, path, resolved);\n}\n// prettier-ignore\nfunction FromTuple(schema, references, path, value) {\n  var value1 = Default(schema, path, value);\n  return (0, index_6.IsArray)(schema.items) ? schema.items.map(function (schema, index) {\n    return Visit(schema, references, \"\".concat(path, \"/\").concat(index), value1[index]);\n  }) : [];\n}\n// prettier-ignore\nfunction FromUnion(schema, references, path, value) {\n  // test value against union variants\n  var _iterator7 = _createForOfIteratorHelper(schema.anyOf),\n    _step7;\n  try {\n    for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n      var subschema = _step7.value;\n      if (!(0, index_5.Check)(subschema, references, value)) continue;\n      var value1 = Visit(subschema, references, path, value);\n      return Default(schema, path, value1);\n    }\n    // test transformed value against union variants\n  } catch (err) {\n    _iterator7.e(err);\n  } finally {\n    _iterator7.f();\n  }\n  var _iterator8 = _createForOfIteratorHelper(schema.anyOf),\n    _step8;\n  try {\n    for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {\n      var _subschema = _step8.value;\n      var _value = Visit(_subschema, references, path, value);\n      if (!(0, index_5.Check)(schema, references, _value)) continue;\n      return Default(schema, path, _value);\n    }\n  } catch (err) {\n    _iterator8.e(err);\n  } finally {\n    _iterator8.f();\n  }\n  return Default(schema, path, value);\n}\n// prettier-ignore\nfunction Visit(schema, references, path, value) {\n  var references_ = (0, index_4.Pushref)(schema, references);\n  var schema_ = schema;\n  switch (schema[index_1.Kind]) {\n    case 'Array':\n      return FromArray(schema_, references_, path, value);\n    case 'Import':\n      return FromImport(schema_, references_, path, value);\n    case 'Intersect':\n      return FromIntersect(schema_, references_, path, value);\n    case 'Not':\n      return FromNot(schema_, references_, path, value);\n    case 'Object':\n      return FromObject(schema_, references_, path, value);\n    case 'Record':\n      return FromRecord(schema_, references_, path, value);\n    case 'Ref':\n      return FromRef(schema_, references_, path, value);\n    case 'This':\n      return FromThis(schema_, references_, path, value);\n    case 'Tuple':\n      return FromTuple(schema_, references_, path, value);\n    case 'Union':\n      return FromUnion(schema_, references_, path, value);\n    default:\n      return Default(schema_, path, value);\n  }\n}\n/**\n * `[Internal]` Encodes the value and returns the result. This function expects the\n * caller to pass a statically checked value. This function does not check the encoded\n * result, meaning the result should be passed to `Check` before use. Refer to the\n * `Value.Encode()` function for implementation details.\n */\nfunction TransformEncode(schema, references, value) {\n  return Visit(schema, references, '', value);\n}\n\n},{\"../../system/policy\":39,\"../../type/error/index\":78,\"../../type/guard/kind\":96,\"../../type/keyof/index\":126,\"../../type/symbols/index\":204,\"../check/index\":238,\"../deref/index\":240,\"../guard/index\":242}],247:[function(require,module,exports){\n\"use strict\";\n\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.HasTransform = HasTransform;\nvar index_1 = require(\"../deref/index\");\nvar index_2 = require(\"../../type/symbols/index\");\n// ------------------------------------------------------------------\n// KindGuard\n// ------------------------------------------------------------------\nvar kind_1 = require(\"../../type/guard/kind\");\n// ------------------------------------------------------------------\n// ValueGuard\n// ------------------------------------------------------------------\nvar index_3 = require(\"../guard/index\");\n// prettier-ignore\nfunction FromArray(schema, references) {\n  return (0, kind_1.IsTransform)(schema) || Visit(schema.items, references);\n}\n// prettier-ignore\nfunction FromAsyncIterator(schema, references) {\n  return (0, kind_1.IsTransform)(schema) || Visit(schema.items, references);\n}\n// prettier-ignore\nfunction FromConstructor(schema, references) {\n  return (0, kind_1.IsTransform)(schema) || Visit(schema.returns, references) || schema.parameters.some(function (schema) {\n    return Visit(schema, references);\n  });\n}\n// prettier-ignore\nfunction FromFunction(schema, references) {\n  return (0, kind_1.IsTransform)(schema) || Visit(schema.returns, references) || schema.parameters.some(function (schema) {\n    return Visit(schema, references);\n  });\n}\n// prettier-ignore\nfunction FromIntersect(schema, references) {\n  return (0, kind_1.IsTransform)(schema) || (0, kind_1.IsTransform)(schema.unevaluatedProperties) || schema.allOf.some(function (schema) {\n    return Visit(schema, references);\n  });\n}\n// prettier-ignore\nfunction FromImport(schema, references) {\n  var additional = globalThis.Object.getOwnPropertyNames(schema.$defs).reduce(function (result, key) {\n    return [].concat(_toConsumableArray(result), [schema.$defs[key]]);\n  }, []);\n  var target = schema.$defs[schema.$ref];\n  return (0, kind_1.IsTransform)(schema) || Visit(target, [].concat(_toConsumableArray(additional), _toConsumableArray(references)));\n}\n// prettier-ignore\nfunction FromIterator(schema, references) {\n  return (0, kind_1.IsTransform)(schema) || Visit(schema.items, references);\n}\n// prettier-ignore\nfunction FromNot(schema, references) {\n  return (0, kind_1.IsTransform)(schema) || Visit(schema.not, references);\n}\n// prettier-ignore\nfunction FromObject(schema, references) {\n  return (0, kind_1.IsTransform)(schema) || Object.values(schema.properties).some(function (schema) {\n    return Visit(schema, references);\n  }) || (0, kind_1.IsSchema)(schema.additionalProperties) && Visit(schema.additionalProperties, references);\n}\n// prettier-ignore\nfunction FromPromise(schema, references) {\n  return (0, kind_1.IsTransform)(schema) || Visit(schema.item, references);\n}\n// prettier-ignore\nfunction FromRecord(schema, references) {\n  var pattern = Object.getOwnPropertyNames(schema.patternProperties)[0];\n  var property = schema.patternProperties[pattern];\n  return (0, kind_1.IsTransform)(schema) || Visit(property, references) || (0, kind_1.IsSchema)(schema.additionalProperties) && (0, kind_1.IsTransform)(schema.additionalProperties);\n}\n// prettier-ignore\nfunction FromRef(schema, references) {\n  if ((0, kind_1.IsTransform)(schema)) return true;\n  return Visit((0, index_1.Deref)(schema, references), references);\n}\n// prettier-ignore\nfunction FromThis(schema, references) {\n  if ((0, kind_1.IsTransform)(schema)) return true;\n  return Visit((0, index_1.Deref)(schema, references), references);\n}\n// prettier-ignore\nfunction FromTuple(schema, references) {\n  return (0, kind_1.IsTransform)(schema) || !(0, index_3.IsUndefined)(schema.items) && schema.items.some(function (schema) {\n    return Visit(schema, references);\n  });\n}\n// prettier-ignore\nfunction FromUnion(schema, references) {\n  return (0, kind_1.IsTransform)(schema) || schema.anyOf.some(function (schema) {\n    return Visit(schema, references);\n  });\n}\n// prettier-ignore\nfunction Visit(schema, references) {\n  var references_ = (0, index_1.Pushref)(schema, references);\n  var schema_ = schema;\n  if (schema.$id && visited.has(schema.$id)) return false;\n  if (schema.$id) visited.add(schema.$id);\n  switch (schema[index_2.Kind]) {\n    case 'Array':\n      return FromArray(schema_, references_);\n    case 'AsyncIterator':\n      return FromAsyncIterator(schema_, references_);\n    case 'Constructor':\n      return FromConstructor(schema_, references_);\n    case 'Function':\n      return FromFunction(schema_, references_);\n    case 'Import':\n      return FromImport(schema_, references_);\n    case 'Intersect':\n      return FromIntersect(schema_, references_);\n    case 'Iterator':\n      return FromIterator(schema_, references_);\n    case 'Not':\n      return FromNot(schema_, references_);\n    case 'Object':\n      return FromObject(schema_, references_);\n    case 'Promise':\n      return FromPromise(schema_, references_);\n    case 'Record':\n      return FromRecord(schema_, references_);\n    case 'Ref':\n      return FromRef(schema_, references_);\n    case 'This':\n      return FromThis(schema_, references_);\n    case 'Tuple':\n      return FromTuple(schema_, references_);\n    case 'Union':\n      return FromUnion(schema_, references_);\n    default:\n      return (0, kind_1.IsTransform)(schema);\n  }\n}\nvar visited = new Set();\n/** Returns true if this schema contains a transform codec */\nfunction HasTransform(schema, references) {\n  visited.clear();\n  return Visit(schema, references);\n}\n\n},{\"../../type/guard/kind\":96,\"../../type/symbols/index\":204,\"../deref/index\":240,\"../guard/index\":242}],248:[function(require,module,exports){\n\"use strict\";\n\nvar __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function get() {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n__exportStar(require(\"./decode\"), exports);\n__exportStar(require(\"./encode\"), exports);\n__exportStar(require(\"./has\"), exports);\n\n},{\"./decode\":245,\"./encode\":246,\"./has\":247}],249:[function(require,module,exports){\n\n},{}],250:[function(require,module,exports){\n!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},g=\"en\",D={};D[g]=M;var p=\"$isDayjsObject\",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if(\"string\"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split(\"-\");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate(\"s\"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v=\"set\"+(this.$u?\"UTC\":\"\");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+\"Hours\",0);case u:return $(v+\"Minutes\",1);case s:return $(v+\"Seconds\",2);case i:return $(v+\"Milliseconds\",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f=\"set\"+(this.$u?\"UTC\":\"\"),l=(n={},n[a]=f+\"Date\",n[d]=f+\"Date\",n[c]=f+\"Month\",n[h]=f+\"FullYear\",n[u]=f+\"Hours\",n[s]=f+\"Minutes\",n[i]=f+\"Seconds\",n[r]=f+\"Milliseconds\",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||\"YYYY-MM-DDTHH:mm:ssZ\",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,\"0\")},$=f||function(t,e,n){var r=t<12?\"AM\":\"PM\";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case\"YY\":return String(e.$y).slice(-2);case\"YYYY\":return b.s(e.$y,4,\"0\");case\"M\":return a+1;case\"MM\":return b.s(a+1,2,\"0\");case\"MMM\":return h(n.monthsShort,a,c,3);case\"MMMM\":return h(c,a);case\"D\":return e.$D;case\"DD\":return b.s(e.$D,2,\"0\");case\"d\":return String(e.$W);case\"dd\":return h(n.weekdaysMin,e.$W,o,2);case\"ddd\":return h(n.weekdaysShort,e.$W,o,3);case\"dddd\":return o[e.$W];case\"H\":return String(s);case\"HH\":return b.s(s,2,\"0\");case\"h\":return d(1);case\"hh\":return d(2);case\"a\":return $(s,u,!0);case\"A\":return $(s,u,!1);case\"m\":return String(u);case\"mm\":return b.s(u,2,\"0\");case\"s\":return String(e.$s);case\"ss\":return b.s(e.$s,2,\"0\");case\"SSS\":return b.s(e.$ms,3,\"0\");case\"Z\":return i}return null}(t)||i.replace(\":\",\"\")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[[\"$ms\",r],[\"$s\",i],[\"$m\",s],[\"$H\",u],[\"$W\",a],[\"$M\",c],[\"$y\",h],[\"$D\",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));\n},{}],251:[function(require,module,exports){\n!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).dayjs_plugin_customParseFormat=t()}(this,(function(){\"use strict\";var e={LTS:\"h:mm:ss A\",LT:\"h:mm A\",L:\"MM/DD/YYYY\",LL:\"MMMM D, YYYY\",LLL:\"MMMM D, YYYY h:mm A\",LLLL:\"dddd, MMMM D, YYYY h:mm A\"},t=/(\\[[^[]*\\])|([-_:/.,()\\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\\d/,r=/\\d\\d/,i=/\\d\\d?/,o=/\\d*[^-_:/,()\\s\\d]+/,s={},a=function(e){return(e=+e)+(e>68?1900:2e3)};var f=function(e){return function(t){this[e]=+t}},h=[/[+-]\\d\\d:?(\\d\\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if(\"Z\"===e)return 0;var t=e.match(/([+-]|\\d\\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:\"+\"===t[0]?-n:n}(e)}],u=function(e){var t=s[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=s.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?\"pm\":\"PM\");return n},c={A:[o,function(e){this.afternoon=d(e,!1)}],a:[o,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*+e}],SS:[r,function(e){this.milliseconds=10*+e}],SSS:[/\\d{3}/,function(e){this.milliseconds=+e}],s:[i,f(\"seconds\")],ss:[i,f(\"seconds\")],m:[i,f(\"minutes\")],mm:[i,f(\"minutes\")],H:[i,f(\"hours\")],h:[i,f(\"hours\")],HH:[i,f(\"hours\")],hh:[i,f(\"hours\")],D:[i,f(\"day\")],DD:[r,f(\"day\")],Do:[o,function(e){var t=s.ordinal,n=e.match(/\\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\\[|\\]/g,\"\")===e&&(this.day=r)}],w:[i,f(\"week\")],ww:[r,f(\"week\")],M:[i,f(\"month\")],MM:[r,f(\"month\")],MMM:[o,function(e){var t=u(\"months\"),n=(u(\"monthsShort\")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[o,function(e){var t=u(\"months\").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\\d+/,f(\"year\")],YY:[r,function(e){this.year=a(e)}],YYYY:[/\\d{4}/,f(\"year\")],Z:h,ZZ:h};function l(n){var r,i;r=n,i=s&&s.formats;for(var o=(n=r.replace(/(\\[[^\\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\\[[^\\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=o.length,f=0;f<a;f+=1){var h=o[f],u=c[h],d=u&&u[0],l=u&&u[1];o[f]=l?{regex:d,parser:l}:h.replace(/^\\[|\\]$/g,\"\")}return function(e){for(var t={},n=0,r=0;n<a;n+=1){var i=o[n];if(\"string\"==typeof i)r+=i.length;else{var s=i.regex,f=i.parser,h=e.slice(r),u=s.exec(h)[0];f.call(t,u),e=e.replace(u,\"\")}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(a=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,o=e.args;this.$u=r;var a=o[1];if(\"string\"==typeof a){var f=!0===o[2],h=!0===o[3],u=f||h,d=o[2];h&&(d=o[2]),s=this.$locale(),!f&&d&&(s=n.Ls[d]),this.$d=function(e,t,n,r){try{if([\"x\",\"X\"].indexOf(t)>-1)return new Date((\"X\"===t?1e3:1)*e);var i=l(t)(e),o=i.year,s=i.month,a=i.day,f=i.hours,h=i.minutes,u=i.seconds,d=i.milliseconds,c=i.zone,m=i.week,M=new Date,Y=a||(o||s?1:M.getDate()),p=o||M.getFullYear(),v=0;o&&!s||(v=s>0?s-1:M.getMonth());var D,w=f||0,g=h||0,y=u||0,L=d||0;return c?new Date(Date.UTC(p,v,Y,w,g,y,L+60*c.offset*1e3)):n?new Date(Date.UTC(p,v,Y,w,g,y,L)):(D=new Date(p,v,Y,w,g,y,L),m&&(D=r(D).week(m).toDate()),D)}catch(e){return new Date(\"\")}}(t,a,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date(\"\")),s={}}else if(a instanceof Array)for(var c=a.length,m=1;m<=c;m+=1){o[1]=a[m-1];var M=n.apply(this,o);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===c&&(this.$d=new Date(\"\"))}else i.call(this,e)}}}));\n},{}],252:[function(require,module,exports){\n!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).dayjs_plugin_isSameOrAfter=t()}(this,(function(){\"use strict\";return function(e,t){t.prototype.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)}}}));\n},{}],253:[function(require,module,exports){\n!function(t,i){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=i():\"function\"==typeof define&&define.amd?define(i):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs_plugin_utc=i()}(this,(function(){\"use strict\";var t=\"minute\",i=/[+-]\\d\\d(?::?\\d\\d)?/g,e=/([+-]|\\d\\d)/g;return function(s,f,n){var u=f.prototype;n.utc=function(t){var i={date:t,utc:!0,args:arguments};return new f(i)},u.utc=function(i){var e=n(this.toDate(),{locale:this.$L,utc:!0});return i?e.add(this.utcOffset(),t):e},u.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var o=u.parse;u.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),o.call(this,t)};var r=u.init;u.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else r.call(this)};var a=u.utcOffset;u.utcOffset=function(s,f){var n=this.$utils().u;if(n(s))return this.$u?0:n(this.$offset)?a.call(this):this.$offset;if(\"string\"==typeof s&&(s=function(t){void 0===t&&(t=\"\");var s=t.match(i);if(!s)return null;var f=(\"\"+s[0]).match(e)||[\"-\",0,0],n=f[0],u=60*+f[1]+ +f[2];return 0===u?0:\"+\"===n?u:-u}(s),null===s))return this;var u=Math.abs(s)<=16?60*s:s,o=this;if(f)return o.$offset=u,o.$u=0===s,o;if(0!==s){var r=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(u+r,t)).$offset=u,o.$x.$localOffset=r}else o=this.utc();return o};var h=u.format;u.format=function(t){var i=t||(this.$u?\"YYYY-MM-DDTHH:mm:ss[Z]\":\"\");return h.call(this,i)},u.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},u.isUTC=function(){return!!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var l=u.toDate;u.toDate=function(t){return\"s\"===t&&this.$offset?n(this.format(\"YYYY-MM-DD HH:mm:ss:SSS\")).toDate():l.call(this)};var c=u.diff;u.diff=function(t,i,e){if(t&&this.$u===t.$u)return c.call(this,t,i,e);var s=this.local(),f=n(t).local();return c.call(s,f,i,e)}}}));\n},{}],254:[function(require,module,exports){\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n  typeof define === 'function' && define.amd ? define(['exports'], factory) :\n  (global = global || self, factory(global.exprEval = {}));\n}(this, function (exports) { 'use strict';\n\n  var INUMBER = 'INUMBER';\n  var IOP1 = 'IOP1';\n  var IOP2 = 'IOP2';\n  var IOP3 = 'IOP3';\n  var IVAR = 'IVAR';\n  var IVARNAME = 'IVARNAME';\n  var IFUNCALL = 'IFUNCALL';\n  var IFUNDEF = 'IFUNDEF';\n  var IEXPR = 'IEXPR';\n  var IEXPREVAL = 'IEXPREVAL';\n  var IMEMBER = 'IMEMBER';\n  var IENDSTATEMENT = 'IENDSTATEMENT';\n  var IARRAY = 'IARRAY';\n\n  function Instruction(type, value) {\n    this.type = type;\n    this.value = (value !== undefined && value !== null) ? value : 0;\n  }\n\n  Instruction.prototype.toString = function () {\n    switch (this.type) {\n      case INUMBER:\n      case IOP1:\n      case IOP2:\n      case IOP3:\n      case IVAR:\n      case IVARNAME:\n      case IENDSTATEMENT:\n        return this.value;\n      case IFUNCALL:\n        return 'CALL ' + this.value;\n      case IFUNDEF:\n        return 'DEF ' + this.value;\n      case IARRAY:\n        return 'ARRAY ' + this.value;\n      case IMEMBER:\n        return '.' + this.value;\n      default:\n        return 'Invalid Instruction';\n    }\n  };\n\n  function unaryInstruction(value) {\n    return new Instruction(IOP1, value);\n  }\n\n  function binaryInstruction(value) {\n    return new Instruction(IOP2, value);\n  }\n\n  function ternaryInstruction(value) {\n    return new Instruction(IOP3, value);\n  }\n\n  function simplify(tokens, unaryOps, binaryOps, ternaryOps, values) {\n    var nstack = [];\n    var newexpression = [];\n    var n1, n2, n3;\n    var f;\n    for (var i = 0; i < tokens.length; i++) {\n      var item = tokens[i];\n      var type = item.type;\n      if (type === INUMBER || type === IVARNAME) {\n        if (Array.isArray(item.value)) {\n          nstack.push.apply(nstack, simplify(item.value.map(function (x) {\n            return new Instruction(INUMBER, x);\n          }).concat(new Instruction(IARRAY, item.value.length)), unaryOps, binaryOps, ternaryOps, values));\n        } else {\n          nstack.push(item);\n        }\n      } else if (type === IVAR && values.hasOwnProperty(item.value)) {\n        item = new Instruction(INUMBER, values[item.value]);\n        nstack.push(item);\n      } else if (type === IOP2 && nstack.length > 1) {\n        n2 = nstack.pop();\n        n1 = nstack.pop();\n        f = binaryOps[item.value];\n        item = new Instruction(INUMBER, f(n1.value, n2.value));\n        nstack.push(item);\n      } else if (type === IOP3 && nstack.length > 2) {\n        n3 = nstack.pop();\n        n2 = nstack.pop();\n        n1 = nstack.pop();\n        if (item.value === '?') {\n          nstack.push(n1.value ? n2.value : n3.value);\n        } else {\n          f = ternaryOps[item.value];\n          item = new Instruction(INUMBER, f(n1.value, n2.value, n3.value));\n          nstack.push(item);\n        }\n      } else if (type === IOP1 && nstack.length > 0) {\n        n1 = nstack.pop();\n        f = unaryOps[item.value];\n        item = new Instruction(INUMBER, f(n1.value));\n        nstack.push(item);\n      } else if (type === IEXPR) {\n        while (nstack.length > 0) {\n          newexpression.push(nstack.shift());\n        }\n        newexpression.push(new Instruction(IEXPR, simplify(item.value, unaryOps, binaryOps, ternaryOps, values)));\n      } else if (type === IMEMBER && nstack.length > 0) {\n        n1 = nstack.pop();\n        nstack.push(new Instruction(INUMBER, n1.value[item.value]));\n      } /* else if (type === IARRAY && nstack.length >= item.value) {\n        var length = item.value;\n        while (length-- > 0) {\n          newexpression.push(nstack.pop());\n        }\n        newexpression.push(new Instruction(IARRAY, item.value));\n      } */ else {\n        while (nstack.length > 0) {\n          newexpression.push(nstack.shift());\n        }\n        newexpression.push(item);\n      }\n    }\n    while (nstack.length > 0) {\n      newexpression.push(nstack.shift());\n    }\n    return newexpression;\n  }\n\n  function substitute(tokens, variable, expr) {\n    var newexpression = [];\n    for (var i = 0; i < tokens.length; i++) {\n      var item = tokens[i];\n      var type = item.type;\n      if (type === IVAR && item.value === variable) {\n        for (var j = 0; j < expr.tokens.length; j++) {\n          var expritem = expr.tokens[j];\n          var replitem;\n          if (expritem.type === IOP1) {\n            replitem = unaryInstruction(expritem.value);\n          } else if (expritem.type === IOP2) {\n            replitem = binaryInstruction(expritem.value);\n          } else if (expritem.type === IOP3) {\n            replitem = ternaryInstruction(expritem.value);\n          } else {\n            replitem = new Instruction(expritem.type, expritem.value);\n          }\n          newexpression.push(replitem);\n        }\n      } else if (type === IEXPR) {\n        newexpression.push(new Instruction(IEXPR, substitute(item.value, variable, expr)));\n      } else {\n        newexpression.push(item);\n      }\n    }\n    return newexpression;\n  }\n\n  function evaluate(tokens, expr, values) {\n    var nstack = [];\n    var n1, n2, n3;\n    var f, args, argCount;\n\n    if (isExpressionEvaluator(tokens)) {\n      return resolveExpression(tokens, values);\n    }\n\n    var numTokens = tokens.length;\n\n    for (var i = 0; i < numTokens; i++) {\n      var item = tokens[i];\n      var type = item.type;\n      if (type === INUMBER || type === IVARNAME) {\n        nstack.push(item.value);\n      } else if (type === IOP2) {\n        n2 = nstack.pop();\n        n1 = nstack.pop();\n        if (item.value === 'and') {\n          nstack.push(n1 ? !!evaluate(n2, expr, values) : false);\n        } else if (item.value === 'or') {\n          nstack.push(n1 ? true : !!evaluate(n2, expr, values));\n        } else if (item.value === '=') {\n          f = expr.binaryOps[item.value];\n          nstack.push(f(n1, evaluate(n2, expr, values), values));\n        } else {\n          f = expr.binaryOps[item.value];\n          nstack.push(f(resolveExpression(n1, values), resolveExpression(n2, values)));\n        }\n      } else if (type === IOP3) {\n        n3 = nstack.pop();\n        n2 = nstack.pop();\n        n1 = nstack.pop();\n        if (item.value === '?') {\n          nstack.push(evaluate(n1 ? n2 : n3, expr, values));\n        } else {\n          f = expr.ternaryOps[item.value];\n          nstack.push(f(resolveExpression(n1, values), resolveExpression(n2, values), resolveExpression(n3, values)));\n        }\n      } else if (type === IVAR) {\n        if (item.value in expr.functions) {\n          nstack.push(expr.functions[item.value]);\n        } else if (item.value in expr.unaryOps && expr.parser.isOperatorEnabled(item.value)) {\n          nstack.push(expr.unaryOps[item.value]);\n        } else {\n          var v = values[item.value];\n          if (v !== undefined) {\n            nstack.push(v);\n          } else {\n            throw new Error('undefined variable: ' + item.value);\n          }\n        }\n      } else if (type === IOP1) {\n        n1 = nstack.pop();\n        f = expr.unaryOps[item.value];\n        nstack.push(f(resolveExpression(n1, values)));\n      } else if (type === IFUNCALL) {\n        argCount = item.value;\n        args = [];\n        while (argCount-- > 0) {\n          args.unshift(resolveExpression(nstack.pop(), values));\n        }\n        f = nstack.pop();\n        if (f.apply && f.call) {\n          nstack.push(f.apply(undefined, args));\n        } else {\n          throw new Error(f + ' is not a function');\n        }\n      } else if (type === IFUNDEF) {\n        // Create closure to keep references to arguments and expression\n        nstack.push((function () {\n          var n2 = nstack.pop();\n          var args = [];\n          var argCount = item.value;\n          while (argCount-- > 0) {\n            args.unshift(nstack.pop());\n          }\n          var n1 = nstack.pop();\n          var f = function () {\n            var scope = Object.assign({}, values);\n            for (var i = 0, len = args.length; i < len; i++) {\n              scope[args[i]] = arguments[i];\n            }\n            return evaluate(n2, expr, scope);\n          };\n          // f.name = n1\n          Object.defineProperty(f, 'name', {\n            value: n1,\n            writable: false\n          });\n          values[n1] = f;\n          return f;\n        })());\n      } else if (type === IEXPR) {\n        nstack.push(createExpressionEvaluator(item, expr));\n      } else if (type === IEXPREVAL) {\n        nstack.push(item);\n      } else if (type === IMEMBER) {\n        n1 = nstack.pop();\n        nstack.push(n1[item.value]);\n      } else if (type === IENDSTATEMENT) {\n        nstack.pop();\n      } else if (type === IARRAY) {\n        argCount = item.value;\n        args = [];\n        while (argCount-- > 0) {\n          args.unshift(nstack.pop());\n        }\n        nstack.push(args);\n      } else {\n        throw new Error('invalid Expression');\n      }\n    }\n    if (nstack.length > 1) {\n      throw new Error('invalid Expression (parity)');\n    }\n    // Explicitly return zero to avoid test issues caused by -0\n    return nstack[0] === 0 ? 0 : resolveExpression(nstack[0], values);\n  }\n\n  function createExpressionEvaluator(token, expr, values) {\n    if (isExpressionEvaluator(token)) return token;\n    return {\n      type: IEXPREVAL,\n      value: function (scope) {\n        return evaluate(token.value, expr, scope);\n      }\n    };\n  }\n\n  function isExpressionEvaluator(n) {\n    return n && n.type === IEXPREVAL;\n  }\n\n  function resolveExpression(n, values) {\n    return isExpressionEvaluator(n) ? n.value(values) : n;\n  }\n\n  function expressionToString(tokens, toJS) {\n    var nstack = [];\n    var n1, n2, n3;\n    var f, args, argCount;\n    for (var i = 0; i < tokens.length; i++) {\n      var item = tokens[i];\n      var type = item.type;\n      if (type === INUMBER) {\n        if (typeof item.value === 'number' && item.value < 0) {\n          nstack.push('(' + item.value + ')');\n        } else if (Array.isArray(item.value)) {\n          nstack.push('[' + item.value.map(escapeValue).join(', ') + ']');\n        } else {\n          nstack.push(escapeValue(item.value));\n        }\n      } else if (type === IOP2) {\n        n2 = nstack.pop();\n        n1 = nstack.pop();\n        f = item.value;\n        if (toJS) {\n          if (f === '^') {\n            nstack.push('Math.pow(' + n1 + ', ' + n2 + ')');\n          } else if (f === 'and') {\n            nstack.push('(!!' + n1 + ' && !!' + n2 + ')');\n          } else if (f === 'or') {\n            nstack.push('(!!' + n1 + ' || !!' + n2 + ')');\n          } else if (f === '||') {\n            nstack.push('(function(a,b){ return Array.isArray(a) && Array.isArray(b) ? a.concat(b) : String(a) + String(b); }((' + n1 + '),(' + n2 + ')))');\n          } else if (f === '==') {\n            nstack.push('(' + n1 + ' === ' + n2 + ')');\n          } else if (f === '!=') {\n            nstack.push('(' + n1 + ' !== ' + n2 + ')');\n          } else if (f === '[') {\n            nstack.push(n1 + '[(' + n2 + ') | 0]');\n          } else {\n            nstack.push('(' + n1 + ' ' + f + ' ' + n2 + ')');\n          }\n        } else {\n          if (f === '[') {\n            nstack.push(n1 + '[' + n2 + ']');\n          } else {\n            nstack.push('(' + n1 + ' ' + f + ' ' + n2 + ')');\n          }\n        }\n      } else if (type === IOP3) {\n        n3 = nstack.pop();\n        n2 = nstack.pop();\n        n1 = nstack.pop();\n        f = item.value;\n        if (f === '?') {\n          nstack.push('(' + n1 + ' ? ' + n2 + ' : ' + n3 + ')');\n        } else {\n          throw new Error('invalid Expression');\n        }\n      } else if (type === IVAR || type === IVARNAME) {\n        nstack.push(item.value);\n      } else if (type === IOP1) {\n        n1 = nstack.pop();\n        f = item.value;\n        if (f === '-' || f === '+') {\n          nstack.push('(' + f + n1 + ')');\n        } else if (toJS) {\n          if (f === 'not') {\n            nstack.push('(' + '!' + n1 + ')');\n          } else if (f === '!') {\n            nstack.push('fac(' + n1 + ')');\n          } else {\n            nstack.push(f + '(' + n1 + ')');\n          }\n        } else if (f === '!') {\n          nstack.push('(' + n1 + '!)');\n        } else {\n          nstack.push('(' + f + ' ' + n1 + ')');\n        }\n      } else if (type === IFUNCALL) {\n        argCount = item.value;\n        args = [];\n        while (argCount-- > 0) {\n          args.unshift(nstack.pop());\n        }\n        f = nstack.pop();\n        nstack.push(f + '(' + args.join(', ') + ')');\n      } else if (type === IFUNDEF) {\n        n2 = nstack.pop();\n        argCount = item.value;\n        args = [];\n        while (argCount-- > 0) {\n          args.unshift(nstack.pop());\n        }\n        n1 = nstack.pop();\n        if (toJS) {\n          nstack.push('(' + n1 + ' = function(' + args.join(', ') + ') { return ' + n2 + ' })');\n        } else {\n          nstack.push('(' + n1 + '(' + args.join(', ') + ') = ' + n2 + ')');\n        }\n      } else if (type === IMEMBER) {\n        n1 = nstack.pop();\n        nstack.push(n1 + '.' + item.value);\n      } else if (type === IARRAY) {\n        argCount = item.value;\n        args = [];\n        while (argCount-- > 0) {\n          args.unshift(nstack.pop());\n        }\n        nstack.push('[' + args.join(', ') + ']');\n      } else if (type === IEXPR) {\n        nstack.push('(' + expressionToString(item.value, toJS) + ')');\n      } else if (type === IENDSTATEMENT) ; else {\n        throw new Error('invalid Expression');\n      }\n    }\n    if (nstack.length > 1) {\n      if (toJS) {\n        nstack = [ nstack.join(',') ];\n      } else {\n        nstack = [ nstack.join(';') ];\n      }\n    }\n    return String(nstack[0]);\n  }\n\n  function escapeValue(v) {\n    if (typeof v === 'string') {\n      return JSON.stringify(v).replace(/\\u2028/g, '\\\\u2028').replace(/\\u2029/g, '\\\\u2029');\n    }\n    return v;\n  }\n\n  function contains(array, obj) {\n    for (var i = 0; i < array.length; i++) {\n      if (array[i] === obj) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  function getSymbols(tokens, symbols, options) {\n    options = options || {};\n    var withMembers = !!options.withMembers;\n    var prevVar = null;\n\n    for (var i = 0; i < tokens.length; i++) {\n      var item = tokens[i];\n      if (item.type === IVAR || item.type === IVARNAME) {\n        if (!withMembers && !contains(symbols, item.value)) {\n          symbols.push(item.value);\n        } else if (prevVar !== null) {\n          if (!contains(symbols, prevVar)) {\n            symbols.push(prevVar);\n          }\n          prevVar = item.value;\n        } else {\n          prevVar = item.value;\n        }\n      } else if (item.type === IMEMBER && withMembers && prevVar !== null) {\n        prevVar += '.' + item.value;\n      } else if (item.type === IEXPR) {\n        getSymbols(item.value, symbols, options);\n      } else if (prevVar !== null) {\n        if (!contains(symbols, prevVar)) {\n          symbols.push(prevVar);\n        }\n        prevVar = null;\n      }\n    }\n\n    if (prevVar !== null && !contains(symbols, prevVar)) {\n      symbols.push(prevVar);\n    }\n  }\n\n  function Expression(tokens, parser) {\n    this.tokens = tokens;\n    this.parser = parser;\n    this.unaryOps = parser.unaryOps;\n    this.binaryOps = parser.binaryOps;\n    this.ternaryOps = parser.ternaryOps;\n    this.functions = parser.functions;\n  }\n\n  Expression.prototype.simplify = function (values) {\n    values = values || {};\n    return new Expression(simplify(this.tokens, this.unaryOps, this.binaryOps, this.ternaryOps, values), this.parser);\n  };\n\n  Expression.prototype.substitute = function (variable, expr) {\n    if (!(expr instanceof Expression)) {\n      expr = this.parser.parse(String(expr));\n    }\n\n    return new Expression(substitute(this.tokens, variable, expr), this.parser);\n  };\n\n  Expression.prototype.evaluate = function (values) {\n    values = values || {};\n    return evaluate(this.tokens, this, values);\n  };\n\n  Expression.prototype.toString = function () {\n    return expressionToString(this.tokens, false);\n  };\n\n  Expression.prototype.symbols = function (options) {\n    options = options || {};\n    var vars = [];\n    getSymbols(this.tokens, vars, options);\n    return vars;\n  };\n\n  Expression.prototype.variables = function (options) {\n    options = options || {};\n    var vars = [];\n    getSymbols(this.tokens, vars, options);\n    var functions = this.functions;\n    return vars.filter(function (name) {\n      return !(name in functions);\n    });\n  };\n\n  Expression.prototype.toJSFunction = function (param, variables) {\n    var expr = this;\n    var f = new Function(param, 'with(this.functions) with (this.ternaryOps) with (this.binaryOps) with (this.unaryOps) { return ' + expressionToString(this.simplify(variables).tokens, true) + '; }'); // eslint-disable-line no-new-func\n    return function () {\n      return f.apply(expr, arguments);\n    };\n  };\n\n  var TEOF = 'TEOF';\n  var TOP = 'TOP';\n  var TNUMBER = 'TNUMBER';\n  var TSTRING = 'TSTRING';\n  var TPAREN = 'TPAREN';\n  var TBRACKET = 'TBRACKET';\n  var TCOMMA = 'TCOMMA';\n  var TNAME = 'TNAME';\n  var TSEMICOLON = 'TSEMICOLON';\n\n  function Token(type, value, index) {\n    this.type = type;\n    this.value = value;\n    this.index = index;\n  }\n\n  Token.prototype.toString = function () {\n    return this.type + ': ' + this.value;\n  };\n\n  function TokenStream(parser, expression) {\n    this.pos = 0;\n    this.current = null;\n    this.unaryOps = parser.unaryOps;\n    this.binaryOps = parser.binaryOps;\n    this.ternaryOps = parser.ternaryOps;\n    this.consts = parser.consts;\n    this.expression = expression;\n    this.savedPosition = 0;\n    this.savedCurrent = null;\n    this.options = parser.options;\n    this.parser = parser;\n  }\n\n  TokenStream.prototype.newToken = function (type, value, pos) {\n    return new Token(type, value, pos != null ? pos : this.pos);\n  };\n\n  TokenStream.prototype.save = function () {\n    this.savedPosition = this.pos;\n    this.savedCurrent = this.current;\n  };\n\n  TokenStream.prototype.restore = function () {\n    this.pos = this.savedPosition;\n    this.current = this.savedCurrent;\n  };\n\n  TokenStream.prototype.next = function () {\n    if (this.pos >= this.expression.length) {\n      return this.newToken(TEOF, 'EOF');\n    }\n\n    if (this.isWhitespace() || this.isComment()) {\n      return this.next();\n    } else if (this.isRadixInteger() ||\n        this.isNumber() ||\n        this.isOperator() ||\n        this.isString() ||\n        this.isParen() ||\n        this.isBracket() ||\n        this.isComma() ||\n        this.isSemicolon() ||\n        this.isNamedOp() ||\n        this.isConst() ||\n        this.isName()) {\n      return this.current;\n    } else {\n      this.parseError('Unknown character \"' + this.expression.charAt(this.pos) + '\"');\n    }\n  };\n\n  TokenStream.prototype.isString = function () {\n    var r = false;\n    var startPos = this.pos;\n    var quote = this.expression.charAt(startPos);\n\n    if (quote === '\\'' || quote === '\"') {\n      var index = this.expression.indexOf(quote, startPos + 1);\n      while (index >= 0 && this.pos < this.expression.length) {\n        this.pos = index + 1;\n        if (this.expression.charAt(index - 1) !== '\\\\') {\n          var rawString = this.expression.substring(startPos + 1, index);\n          this.current = this.newToken(TSTRING, this.unescape(rawString), startPos);\n          r = true;\n          break;\n        }\n        index = this.expression.indexOf(quote, index + 1);\n      }\n    }\n    return r;\n  };\n\n  TokenStream.prototype.isParen = function () {\n    var c = this.expression.charAt(this.pos);\n    if (c === '(' || c === ')') {\n      this.current = this.newToken(TPAREN, c);\n      this.pos++;\n      return true;\n    }\n    return false;\n  };\n\n  TokenStream.prototype.isBracket = function () {\n    var c = this.expression.charAt(this.pos);\n    if ((c === '[' || c === ']') && this.isOperatorEnabled('[')) {\n      this.current = this.newToken(TBRACKET, c);\n      this.pos++;\n      return true;\n    }\n    return false;\n  };\n\n  TokenStream.prototype.isComma = function () {\n    var c = this.expression.charAt(this.pos);\n    if (c === ',') {\n      this.current = this.newToken(TCOMMA, ',');\n      this.pos++;\n      return true;\n    }\n    return false;\n  };\n\n  TokenStream.prototype.isSemicolon = function () {\n    var c = this.expression.charAt(this.pos);\n    if (c === ';') {\n      this.current = this.newToken(TSEMICOLON, ';');\n      this.pos++;\n      return true;\n    }\n    return false;\n  };\n\n  TokenStream.prototype.isConst = function () {\n    var startPos = this.pos;\n    var i = startPos;\n    for (; i < this.expression.length; i++) {\n      var c = this.expression.charAt(i);\n      if (c.toUpperCase() === c.toLowerCase()) {\n        if (i === this.pos || (c !== '_' && c !== '.' && (c < '0' || c > '9'))) {\n          break;\n        }\n      }\n    }\n    if (i > startPos) {\n      var str = this.expression.substring(startPos, i);\n      if (str in this.consts) {\n        this.current = this.newToken(TNUMBER, this.consts[str]);\n        this.pos += str.length;\n        return true;\n      }\n    }\n    return false;\n  };\n\n  TokenStream.prototype.isNamedOp = function () {\n    var startPos = this.pos;\n    var i = startPos;\n    for (; i < this.expression.length; i++) {\n      var c = this.expression.charAt(i);\n      if (c.toUpperCase() === c.toLowerCase()) {\n        if (i === this.pos || (c !== '_' && (c < '0' || c > '9'))) {\n          break;\n        }\n      }\n    }\n    if (i > startPos) {\n      var str = this.expression.substring(startPos, i);\n      if (this.isOperatorEnabled(str) && (str in this.binaryOps || str in this.unaryOps || str in this.ternaryOps)) {\n        this.current = this.newToken(TOP, str);\n        this.pos += str.length;\n        return true;\n      }\n    }\n    return false;\n  };\n\n  TokenStream.prototype.isName = function () {\n    var startPos = this.pos;\n    var i = startPos;\n    var hasLetter = false;\n    for (; i < this.expression.length; i++) {\n      var c = this.expression.charAt(i);\n      if (c.toUpperCase() === c.toLowerCase()) {\n        if (i === this.pos && (c === '$' || c === '_')) {\n          if (c === '_') {\n            hasLetter = true;\n          }\n          continue;\n        } else if (i === this.pos || !hasLetter || (c !== '_' && (c < '0' || c > '9'))) {\n          break;\n        }\n      } else {\n        hasLetter = true;\n      }\n    }\n    if (hasLetter) {\n      var str = this.expression.substring(startPos, i);\n      this.current = this.newToken(TNAME, str);\n      this.pos += str.length;\n      return true;\n    }\n    return false;\n  };\n\n  TokenStream.prototype.isWhitespace = function () {\n    var r = false;\n    var c = this.expression.charAt(this.pos);\n    while (c === ' ' || c === '\\t' || c === '\\n' || c === '\\r') {\n      r = true;\n      this.pos++;\n      if (this.pos >= this.expression.length) {\n        break;\n      }\n      c = this.expression.charAt(this.pos);\n    }\n    return r;\n  };\n\n  var codePointPattern = /^[0-9a-f]{4}$/i;\n\n  TokenStream.prototype.unescape = function (v) {\n    var index = v.indexOf('\\\\');\n    if (index < 0) {\n      return v;\n    }\n\n    var buffer = v.substring(0, index);\n    while (index >= 0) {\n      var c = v.charAt(++index);\n      switch (c) {\n        case '\\'':\n          buffer += '\\'';\n          break;\n        case '\"':\n          buffer += '\"';\n          break;\n        case '\\\\':\n          buffer += '\\\\';\n          break;\n        case '/':\n          buffer += '/';\n          break;\n        case 'b':\n          buffer += '\\b';\n          break;\n        case 'f':\n          buffer += '\\f';\n          break;\n        case 'n':\n          buffer += '\\n';\n          break;\n        case 'r':\n          buffer += '\\r';\n          break;\n        case 't':\n          buffer += '\\t';\n          break;\n        case 'u':\n          // interpret the following 4 characters as the hex of the unicode code point\n          var codePoint = v.substring(index + 1, index + 5);\n          if (!codePointPattern.test(codePoint)) {\n            this.parseError('Illegal escape sequence: \\\\u' + codePoint);\n          }\n          buffer += String.fromCharCode(parseInt(codePoint, 16));\n          index += 4;\n          break;\n        default:\n          throw this.parseError('Illegal escape sequence: \"\\\\' + c + '\"');\n      }\n      ++index;\n      var backslash = v.indexOf('\\\\', index);\n      buffer += v.substring(index, backslash < 0 ? v.length : backslash);\n      index = backslash;\n    }\n\n    return buffer;\n  };\n\n  TokenStream.prototype.isComment = function () {\n    var c = this.expression.charAt(this.pos);\n    if (c === '/' && this.expression.charAt(this.pos + 1) === '*') {\n      this.pos = this.expression.indexOf('*/', this.pos) + 2;\n      if (this.pos === 1) {\n        this.pos = this.expression.length;\n      }\n      return true;\n    }\n    return false;\n  };\n\n  TokenStream.prototype.isRadixInteger = function () {\n    var pos = this.pos;\n\n    if (pos >= this.expression.length - 2 || this.expression.charAt(pos) !== '0') {\n      return false;\n    }\n    ++pos;\n\n    var radix;\n    var validDigit;\n    if (this.expression.charAt(pos) === 'x') {\n      radix = 16;\n      validDigit = /^[0-9a-f]$/i;\n      ++pos;\n    } else if (this.expression.charAt(pos) === 'b') {\n      radix = 2;\n      validDigit = /^[01]$/i;\n      ++pos;\n    } else {\n      return false;\n    }\n\n    var valid = false;\n    var startPos = pos;\n\n    while (pos < this.expression.length) {\n      var c = this.expression.charAt(pos);\n      if (validDigit.test(c)) {\n        pos++;\n        valid = true;\n      } else {\n        break;\n      }\n    }\n\n    if (valid) {\n      this.current = this.newToken(TNUMBER, parseInt(this.expression.substring(startPos, pos), radix));\n      this.pos = pos;\n    }\n    return valid;\n  };\n\n  TokenStream.prototype.isNumber = function () {\n    var valid = false;\n    var pos = this.pos;\n    var startPos = pos;\n    var resetPos = pos;\n    var foundDot = false;\n    var foundDigits = false;\n    var c;\n\n    while (pos < this.expression.length) {\n      c = this.expression.charAt(pos);\n      if ((c >= '0' && c <= '9') || (!foundDot && c === '.')) {\n        if (c === '.') {\n          foundDot = true;\n        } else {\n          foundDigits = true;\n        }\n        pos++;\n        valid = foundDigits;\n      } else {\n        break;\n      }\n    }\n\n    if (valid) {\n      resetPos = pos;\n    }\n\n    if (c === 'e' || c === 'E') {\n      pos++;\n      var acceptSign = true;\n      var validExponent = false;\n      while (pos < this.expression.length) {\n        c = this.expression.charAt(pos);\n        if (acceptSign && (c === '+' || c === '-')) {\n          acceptSign = false;\n        } else if (c >= '0' && c <= '9') {\n          validExponent = true;\n          acceptSign = false;\n        } else {\n          break;\n        }\n        pos++;\n      }\n\n      if (!validExponent) {\n        pos = resetPos;\n      }\n    }\n\n    if (valid) {\n      this.current = this.newToken(TNUMBER, parseFloat(this.expression.substring(startPos, pos)));\n      this.pos = pos;\n    } else {\n      this.pos = resetPos;\n    }\n    return valid;\n  };\n\n  TokenStream.prototype.isOperator = function () {\n    var startPos = this.pos;\n    var c = this.expression.charAt(this.pos);\n\n    if (c === '+' || c === '-' || c === '*' || c === '/' || c === '%' || c === '^' || c === '?' || c === ':' || c === '.') {\n      this.current = this.newToken(TOP, c);\n    } else if (c === '∙' || c === '•') {\n      this.current = this.newToken(TOP, '*');\n    } else if (c === '>') {\n      if (this.expression.charAt(this.pos + 1) === '=') {\n        this.current = this.newToken(TOP, '>=');\n        this.pos++;\n      } else {\n        this.current = this.newToken(TOP, '>');\n      }\n    } else if (c === '<') {\n      if (this.expression.charAt(this.pos + 1) === '=') {\n        this.current = this.newToken(TOP, '<=');\n        this.pos++;\n      } else {\n        this.current = this.newToken(TOP, '<');\n      }\n    } else if (c === '|') {\n      if (this.expression.charAt(this.pos + 1) === '|') {\n        this.current = this.newToken(TOP, '||');\n        this.pos++;\n      } else {\n        return false;\n      }\n    } else if (c === '=') {\n      if (this.expression.charAt(this.pos + 1) === '=') {\n        this.current = this.newToken(TOP, '==');\n        this.pos++;\n      } else {\n        this.current = this.newToken(TOP, c);\n      }\n    } else if (c === '!') {\n      if (this.expression.charAt(this.pos + 1) === '=') {\n        this.current = this.newToken(TOP, '!=');\n        this.pos++;\n      } else {\n        this.current = this.newToken(TOP, c);\n      }\n    } else {\n      return false;\n    }\n    this.pos++;\n\n    if (this.isOperatorEnabled(this.current.value)) {\n      return true;\n    } else {\n      this.pos = startPos;\n      return false;\n    }\n  };\n\n  TokenStream.prototype.isOperatorEnabled = function (op) {\n    return this.parser.isOperatorEnabled(op);\n  };\n\n  TokenStream.prototype.getCoordinates = function () {\n    var line = 0;\n    var column;\n    var newline = -1;\n    do {\n      line++;\n      column = this.pos - newline;\n      newline = this.expression.indexOf('\\n', newline + 1);\n    } while (newline >= 0 && newline < this.pos);\n\n    return {\n      line: line,\n      column: column\n    };\n  };\n\n  TokenStream.prototype.parseError = function (msg) {\n    var coords = this.getCoordinates();\n    throw new Error('parse error [' + coords.line + ':' + coords.column + ']: ' + msg);\n  };\n\n  function ParserState(parser, tokenStream, options) {\n    this.parser = parser;\n    this.tokens = tokenStream;\n    this.current = null;\n    this.nextToken = null;\n    this.next();\n    this.savedCurrent = null;\n    this.savedNextToken = null;\n    this.allowMemberAccess = options.allowMemberAccess !== false;\n  }\n\n  ParserState.prototype.next = function () {\n    this.current = this.nextToken;\n    return (this.nextToken = this.tokens.next());\n  };\n\n  ParserState.prototype.tokenMatches = function (token, value) {\n    if (typeof value === 'undefined') {\n      return true;\n    } else if (Array.isArray(value)) {\n      return contains(value, token.value);\n    } else if (typeof value === 'function') {\n      return value(token);\n    } else {\n      return token.value === value;\n    }\n  };\n\n  ParserState.prototype.save = function () {\n    this.savedCurrent = this.current;\n    this.savedNextToken = this.nextToken;\n    this.tokens.save();\n  };\n\n  ParserState.prototype.restore = function () {\n    this.tokens.restore();\n    this.current = this.savedCurrent;\n    this.nextToken = this.savedNextToken;\n  };\n\n  ParserState.prototype.accept = function (type, value) {\n    if (this.nextToken.type === type && this.tokenMatches(this.nextToken, value)) {\n      this.next();\n      return true;\n    }\n    return false;\n  };\n\n  ParserState.prototype.expect = function (type, value) {\n    if (!this.accept(type, value)) {\n      var coords = this.tokens.getCoordinates();\n      throw new Error('parse error [' + coords.line + ':' + coords.column + ']: Expected ' + (value || type));\n    }\n  };\n\n  ParserState.prototype.parseAtom = function (instr) {\n    var unaryOps = this.tokens.unaryOps;\n    function isPrefixOperator(token) {\n      return token.value in unaryOps;\n    }\n\n    if (this.accept(TNAME) || this.accept(TOP, isPrefixOperator)) {\n      instr.push(new Instruction(IVAR, this.current.value));\n    } else if (this.accept(TNUMBER)) {\n      instr.push(new Instruction(INUMBER, this.current.value));\n    } else if (this.accept(TSTRING)) {\n      instr.push(new Instruction(INUMBER, this.current.value));\n    } else if (this.accept(TPAREN, '(')) {\n      this.parseExpression(instr);\n      this.expect(TPAREN, ')');\n    } else if (this.accept(TBRACKET, '[')) {\n      if (this.accept(TBRACKET, ']')) {\n        instr.push(new Instruction(IARRAY, 0));\n      } else {\n        var argCount = this.parseArrayList(instr);\n        instr.push(new Instruction(IARRAY, argCount));\n      }\n    } else {\n      throw new Error('unexpected ' + this.nextToken);\n    }\n  };\n\n  ParserState.prototype.parseExpression = function (instr) {\n    var exprInstr = [];\n    if (this.parseUntilEndStatement(instr, exprInstr)) {\n      return;\n    }\n    this.parseVariableAssignmentExpression(exprInstr);\n    if (this.parseUntilEndStatement(instr, exprInstr)) {\n      return;\n    }\n    this.pushExpression(instr, exprInstr);\n  };\n\n  ParserState.prototype.pushExpression = function (instr, exprInstr) {\n    for (var i = 0, len = exprInstr.length; i < len; i++) {\n      instr.push(exprInstr[i]);\n    }\n  };\n\n  ParserState.prototype.parseUntilEndStatement = function (instr, exprInstr) {\n    if (!this.accept(TSEMICOLON)) return false;\n    if (this.nextToken && this.nextToken.type !== TEOF && !(this.nextToken.type === TPAREN && this.nextToken.value === ')')) {\n      exprInstr.push(new Instruction(IENDSTATEMENT));\n    }\n    if (this.nextToken.type !== TEOF) {\n      this.parseExpression(exprInstr);\n    }\n    instr.push(new Instruction(IEXPR, exprInstr));\n    return true;\n  };\n\n  ParserState.prototype.parseArrayList = function (instr) {\n    var argCount = 0;\n\n    while (!this.accept(TBRACKET, ']')) {\n      this.parseExpression(instr);\n      ++argCount;\n      while (this.accept(TCOMMA)) {\n        this.parseExpression(instr);\n        ++argCount;\n      }\n    }\n\n    return argCount;\n  };\n\n  ParserState.prototype.parseVariableAssignmentExpression = function (instr) {\n    this.parseConditionalExpression(instr);\n    while (this.accept(TOP, '=')) {\n      var varName = instr.pop();\n      var varValue = [];\n      var lastInstrIndex = instr.length - 1;\n      if (varName.type === IFUNCALL) {\n        if (!this.tokens.isOperatorEnabled('()=')) {\n          throw new Error('function definition is not permitted');\n        }\n        for (var i = 0, len = varName.value + 1; i < len; i++) {\n          var index = lastInstrIndex - i;\n          if (instr[index].type === IVAR) {\n            instr[index] = new Instruction(IVARNAME, instr[index].value);\n          }\n        }\n        this.parseVariableAssignmentExpression(varValue);\n        instr.push(new Instruction(IEXPR, varValue));\n        instr.push(new Instruction(IFUNDEF, varName.value));\n        continue;\n      }\n      if (varName.type !== IVAR && varName.type !== IMEMBER) {\n        throw new Error('expected variable for assignment');\n      }\n      this.parseVariableAssignmentExpression(varValue);\n      instr.push(new Instruction(IVARNAME, varName.value));\n      instr.push(new Instruction(IEXPR, varValue));\n      instr.push(binaryInstruction('='));\n    }\n  };\n\n  ParserState.prototype.parseConditionalExpression = function (instr) {\n    this.parseOrExpression(instr);\n    while (this.accept(TOP, '?')) {\n      var trueBranch = [];\n      var falseBranch = [];\n      this.parseConditionalExpression(trueBranch);\n      this.expect(TOP, ':');\n      this.parseConditionalExpression(falseBranch);\n      instr.push(new Instruction(IEXPR, trueBranch));\n      instr.push(new Instruction(IEXPR, falseBranch));\n      instr.push(ternaryInstruction('?'));\n    }\n  };\n\n  ParserState.prototype.parseOrExpression = function (instr) {\n    this.parseAndExpression(instr);\n    while (this.accept(TOP, 'or')) {\n      var falseBranch = [];\n      this.parseAndExpression(falseBranch);\n      instr.push(new Instruction(IEXPR, falseBranch));\n      instr.push(binaryInstruction('or'));\n    }\n  };\n\n  ParserState.prototype.parseAndExpression = function (instr) {\n    this.parseComparison(instr);\n    while (this.accept(TOP, 'and')) {\n      var trueBranch = [];\n      this.parseComparison(trueBranch);\n      instr.push(new Instruction(IEXPR, trueBranch));\n      instr.push(binaryInstruction('and'));\n    }\n  };\n\n  var COMPARISON_OPERATORS = ['==', '!=', '<', '<=', '>=', '>', 'in'];\n\n  ParserState.prototype.parseComparison = function (instr) {\n    this.parseAddSub(instr);\n    while (this.accept(TOP, COMPARISON_OPERATORS)) {\n      var op = this.current;\n      this.parseAddSub(instr);\n      instr.push(binaryInstruction(op.value));\n    }\n  };\n\n  var ADD_SUB_OPERATORS = ['+', '-', '||'];\n\n  ParserState.prototype.parseAddSub = function (instr) {\n    this.parseTerm(instr);\n    while (this.accept(TOP, ADD_SUB_OPERATORS)) {\n      var op = this.current;\n      this.parseTerm(instr);\n      instr.push(binaryInstruction(op.value));\n    }\n  };\n\n  var TERM_OPERATORS = ['*', '/', '%'];\n\n  ParserState.prototype.parseTerm = function (instr) {\n    this.parseFactor(instr);\n    while (this.accept(TOP, TERM_OPERATORS)) {\n      var op = this.current;\n      this.parseFactor(instr);\n      instr.push(binaryInstruction(op.value));\n    }\n  };\n\n  ParserState.prototype.parseFactor = function (instr) {\n    var unaryOps = this.tokens.unaryOps;\n    function isPrefixOperator(token) {\n      return token.value in unaryOps;\n    }\n\n    this.save();\n    if (this.accept(TOP, isPrefixOperator)) {\n      if (this.current.value !== '-' && this.current.value !== '+') {\n        if (this.nextToken.type === TPAREN && this.nextToken.value === '(') {\n          this.restore();\n          this.parseExponential(instr);\n          return;\n        } else if (this.nextToken.type === TSEMICOLON || this.nextToken.type === TCOMMA || this.nextToken.type === TEOF || (this.nextToken.type === TPAREN && this.nextToken.value === ')')) {\n          this.restore();\n          this.parseAtom(instr);\n          return;\n        }\n      }\n\n      var op = this.current;\n      this.parseFactor(instr);\n      instr.push(unaryInstruction(op.value));\n    } else {\n      this.parseExponential(instr);\n    }\n  };\n\n  ParserState.prototype.parseExponential = function (instr) {\n    this.parsePostfixExpression(instr);\n    while (this.accept(TOP, '^')) {\n      this.parseFactor(instr);\n      instr.push(binaryInstruction('^'));\n    }\n  };\n\n  ParserState.prototype.parsePostfixExpression = function (instr) {\n    this.parseFunctionCall(instr);\n    while (this.accept(TOP, '!')) {\n      instr.push(unaryInstruction('!'));\n    }\n  };\n\n  ParserState.prototype.parseFunctionCall = function (instr) {\n    var unaryOps = this.tokens.unaryOps;\n    function isPrefixOperator(token) {\n      return token.value in unaryOps;\n    }\n\n    if (this.accept(TOP, isPrefixOperator)) {\n      var op = this.current;\n      this.parseAtom(instr);\n      instr.push(unaryInstruction(op.value));\n    } else {\n      this.parseMemberExpression(instr);\n      while (this.accept(TPAREN, '(')) {\n        if (this.accept(TPAREN, ')')) {\n          instr.push(new Instruction(IFUNCALL, 0));\n        } else {\n          var argCount = this.parseArgumentList(instr);\n          instr.push(new Instruction(IFUNCALL, argCount));\n        }\n      }\n    }\n  };\n\n  ParserState.prototype.parseArgumentList = function (instr) {\n    var argCount = 0;\n\n    while (!this.accept(TPAREN, ')')) {\n      this.parseExpression(instr);\n      ++argCount;\n      while (this.accept(TCOMMA)) {\n        this.parseExpression(instr);\n        ++argCount;\n      }\n    }\n\n    return argCount;\n  };\n\n  ParserState.prototype.parseMemberExpression = function (instr) {\n    this.parseAtom(instr);\n    while (this.accept(TOP, '.') || this.accept(TBRACKET, '[')) {\n      var op = this.current;\n\n      if (op.value === '.') {\n        if (!this.allowMemberAccess) {\n          throw new Error('unexpected \".\", member access is not permitted');\n        }\n\n        this.expect(TNAME);\n        instr.push(new Instruction(IMEMBER, this.current.value));\n      } else if (op.value === '[') {\n        if (!this.tokens.isOperatorEnabled('[')) {\n          throw new Error('unexpected \"[]\", arrays are disabled');\n        }\n\n        this.parseExpression(instr);\n        this.expect(TBRACKET, ']');\n        instr.push(binaryInstruction('['));\n      } else {\n        throw new Error('unexpected symbol: ' + op.value);\n      }\n    }\n  };\n\n  function add(a, b) {\n    return Number(a) + Number(b);\n  }\n\n  function sub(a, b) {\n    return a - b;\n  }\n\n  function mul(a, b) {\n    return a * b;\n  }\n\n  function div(a, b) {\n    return a / b;\n  }\n\n  function mod(a, b) {\n    return a % b;\n  }\n\n  function concat(a, b) {\n    if (Array.isArray(a) && Array.isArray(b)) {\n      return a.concat(b);\n    }\n    return '' + a + b;\n  }\n\n  function equal(a, b) {\n    return a === b;\n  }\n\n  function notEqual(a, b) {\n    return a !== b;\n  }\n\n  function greaterThan(a, b) {\n    return a > b;\n  }\n\n  function lessThan(a, b) {\n    return a < b;\n  }\n\n  function greaterThanEqual(a, b) {\n    return a >= b;\n  }\n\n  function lessThanEqual(a, b) {\n    return a <= b;\n  }\n\n  function andOperator(a, b) {\n    return Boolean(a && b);\n  }\n\n  function orOperator(a, b) {\n    return Boolean(a || b);\n  }\n\n  function inOperator(a, b) {\n    return contains(b, a);\n  }\n\n  function sinh(a) {\n    return ((Math.exp(a) - Math.exp(-a)) / 2);\n  }\n\n  function cosh(a) {\n    return ((Math.exp(a) + Math.exp(-a)) / 2);\n  }\n\n  function tanh(a) {\n    if (a === Infinity) return 1;\n    if (a === -Infinity) return -1;\n    return (Math.exp(a) - Math.exp(-a)) / (Math.exp(a) + Math.exp(-a));\n  }\n\n  function asinh(a) {\n    if (a === -Infinity) return a;\n    return Math.log(a + Math.sqrt((a * a) + 1));\n  }\n\n  function acosh(a) {\n    return Math.log(a + Math.sqrt((a * a) - 1));\n  }\n\n  function atanh(a) {\n    return (Math.log((1 + a) / (1 - a)) / 2);\n  }\n\n  function log10(a) {\n    return Math.log(a) * Math.LOG10E;\n  }\n\n  function neg(a) {\n    return -a;\n  }\n\n  function not(a) {\n    return !a;\n  }\n\n  function trunc(a) {\n    return a < 0 ? Math.ceil(a) : Math.floor(a);\n  }\n\n  function random(a) {\n    return Math.random() * (a || 1);\n  }\n\n  function factorial(a) { // a!\n    return gamma(a + 1);\n  }\n\n  function isInteger(value) {\n    return isFinite(value) && (value === Math.round(value));\n  }\n\n  var GAMMA_G = 4.7421875;\n  var GAMMA_P = [\n    0.99999999999999709182,\n    57.156235665862923517, -59.597960355475491248,\n    14.136097974741747174, -0.49191381609762019978,\n    0.33994649984811888699e-4,\n    0.46523628927048575665e-4, -0.98374475304879564677e-4,\n    0.15808870322491248884e-3, -0.21026444172410488319e-3,\n    0.21743961811521264320e-3, -0.16431810653676389022e-3,\n    0.84418223983852743293e-4, -0.26190838401581408670e-4,\n    0.36899182659531622704e-5\n  ];\n\n  // Gamma function from math.js\n  function gamma(n) {\n    var t, x;\n\n    if (isInteger(n)) {\n      if (n <= 0) {\n        return isFinite(n) ? Infinity : NaN;\n      }\n\n      if (n > 171) {\n        return Infinity; // Will overflow\n      }\n\n      var value = n - 2;\n      var res = n - 1;\n      while (value > 1) {\n        res *= value;\n        value--;\n      }\n\n      if (res === 0) {\n        res = 1; // 0! is per definition 1\n      }\n\n      return res;\n    }\n\n    if (n < 0.5) {\n      return Math.PI / (Math.sin(Math.PI * n) * gamma(1 - n));\n    }\n\n    if (n >= 171.35) {\n      return Infinity; // will overflow\n    }\n\n    if (n > 85.0) { // Extended Stirling Approx\n      var twoN = n * n;\n      var threeN = twoN * n;\n      var fourN = threeN * n;\n      var fiveN = fourN * n;\n      return Math.sqrt(2 * Math.PI / n) * Math.pow((n / Math.E), n) *\n        (1 + (1 / (12 * n)) + (1 / (288 * twoN)) - (139 / (51840 * threeN)) -\n        (571 / (2488320 * fourN)) + (163879 / (209018880 * fiveN)) +\n        (5246819 / (75246796800 * fiveN * n)));\n    }\n\n    --n;\n    x = GAMMA_P[0];\n    for (var i = 1; i < GAMMA_P.length; ++i) {\n      x += GAMMA_P[i] / (n + i);\n    }\n\n    t = n + GAMMA_G + 0.5;\n    return Math.sqrt(2 * Math.PI) * Math.pow(t, n + 0.5) * Math.exp(-t) * x;\n  }\n\n  function stringOrArrayLength(s) {\n    if (Array.isArray(s)) {\n      return s.length;\n    }\n    return String(s).length;\n  }\n\n  function hypot() {\n    var sum = 0;\n    var larg = 0;\n    for (var i = 0; i < arguments.length; i++) {\n      var arg = Math.abs(arguments[i]);\n      var div;\n      if (larg < arg) {\n        div = larg / arg;\n        sum = (sum * div * div) + 1;\n        larg = arg;\n      } else if (arg > 0) {\n        div = arg / larg;\n        sum += div * div;\n      } else {\n        sum += arg;\n      }\n    }\n    return larg === Infinity ? Infinity : larg * Math.sqrt(sum);\n  }\n\n  function condition(cond, yep, nope) {\n    return cond ? yep : nope;\n  }\n\n  /**\n  * Decimal adjustment of a number.\n  * From @escopecz.\n  *\n  * @param {Number} value The number.\n  * @param {Integer} exp  The exponent (the 10 logarithm of the adjustment base).\n  * @return {Number} The adjusted value.\n  */\n  function roundTo(value, exp) {\n    // If the exp is undefined or zero...\n    if (typeof exp === 'undefined' || +exp === 0) {\n      return Math.round(value);\n    }\n    value = +value;\n    exp = -(+exp);\n    // If the value is not a number or the exp is not an integer...\n    if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) {\n      return NaN;\n    }\n    // Shift\n    value = value.toString().split('e');\n    value = Math.round(+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp)));\n    // Shift back\n    value = value.toString().split('e');\n    return +(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp));\n  }\n\n  function setVar(name, value, variables) {\n    if (variables) variables[name] = value;\n    return value;\n  }\n\n  function arrayIndex(array, index) {\n    return array[index | 0];\n  }\n\n  function max(array) {\n    if (arguments.length === 1 && Array.isArray(array)) {\n      return Math.max.apply(Math, array);\n    } else {\n      return Math.max.apply(Math, arguments);\n    }\n  }\n\n  function min(array) {\n    if (arguments.length === 1 && Array.isArray(array)) {\n      return Math.min.apply(Math, array);\n    } else {\n      return Math.min.apply(Math, arguments);\n    }\n  }\n\n  function arrayMap(f, a) {\n    if (typeof f !== 'function') {\n      throw new Error('First argument to map is not a function');\n    }\n    if (!Array.isArray(a)) {\n      throw new Error('Second argument to map is not an array');\n    }\n    return a.map(function (x, i) {\n      return f(x, i);\n    });\n  }\n\n  function arrayFold(f, init, a) {\n    if (typeof f !== 'function') {\n      throw new Error('First argument to fold is not a function');\n    }\n    if (!Array.isArray(a)) {\n      throw new Error('Second argument to fold is not an array');\n    }\n    return a.reduce(function (acc, x, i) {\n      return f(acc, x, i);\n    }, init);\n  }\n\n  function arrayFilter(f, a) {\n    if (typeof f !== 'function') {\n      throw new Error('First argument to filter is not a function');\n    }\n    if (!Array.isArray(a)) {\n      throw new Error('Second argument to filter is not an array');\n    }\n    return a.filter(function (x, i) {\n      return f(x, i);\n    });\n  }\n\n  function stringOrArrayIndexOf(target, s) {\n    if (!(Array.isArray(s) || typeof s === 'string')) {\n      throw new Error('Second argument to indexOf is not a string or array');\n    }\n\n    return s.indexOf(target);\n  }\n\n  function arrayJoin(sep, a) {\n    if (!Array.isArray(a)) {\n      throw new Error('Second argument to join is not an array');\n    }\n\n    return a.join(sep);\n  }\n\n  function sign(x) {\n    return ((x > 0) - (x < 0)) || +x;\n  }\n\n  var ONE_THIRD = 1/3;\n  function cbrt(x) {\n    return x < 0 ? -Math.pow(-x, ONE_THIRD) : Math.pow(x, ONE_THIRD);\n  }\n\n  function expm1(x) {\n    return Math.exp(x) - 1;\n  }\n\n  function log1p(x) {\n    return Math.log(1 + x);\n  }\n\n  function log2(x) {\n    return Math.log(x) / Math.LN2;\n  }\n\n  function Parser(options) {\n    this.options = options || {};\n    this.unaryOps = {\n      sin: Math.sin,\n      cos: Math.cos,\n      tan: Math.tan,\n      asin: Math.asin,\n      acos: Math.acos,\n      atan: Math.atan,\n      sinh: Math.sinh || sinh,\n      cosh: Math.cosh || cosh,\n      tanh: Math.tanh || tanh,\n      asinh: Math.asinh || asinh,\n      acosh: Math.acosh || acosh,\n      atanh: Math.atanh || atanh,\n      sqrt: Math.sqrt,\n      cbrt: Math.cbrt || cbrt,\n      log: Math.log,\n      log2: Math.log2 || log2,\n      ln: Math.log,\n      lg: Math.log10 || log10,\n      log10: Math.log10 || log10,\n      expm1: Math.expm1 || expm1,\n      log1p: Math.log1p || log1p,\n      abs: Math.abs,\n      ceil: Math.ceil,\n      floor: Math.floor,\n      round: Math.round,\n      trunc: Math.trunc || trunc,\n      '-': neg,\n      '+': Number,\n      exp: Math.exp,\n      not: not,\n      length: stringOrArrayLength,\n      '!': factorial,\n      sign: Math.sign || sign\n    };\n\n    this.binaryOps = {\n      '+': add,\n      '-': sub,\n      '*': mul,\n      '/': div,\n      '%': mod,\n      '^': Math.pow,\n      '||': concat,\n      '==': equal,\n      '!=': notEqual,\n      '>': greaterThan,\n      '<': lessThan,\n      '>=': greaterThanEqual,\n      '<=': lessThanEqual,\n      and: andOperator,\n      or: orOperator,\n      'in': inOperator,\n      '=': setVar,\n      '[': arrayIndex\n    };\n\n    this.ternaryOps = {\n      '?': condition\n    };\n\n    this.functions = {\n      random: random,\n      fac: factorial,\n      min: min,\n      max: max,\n      hypot: Math.hypot || hypot,\n      pyt: Math.hypot || hypot, // backward compat\n      pow: Math.pow,\n      atan2: Math.atan2,\n      'if': condition,\n      gamma: gamma,\n      roundTo: roundTo,\n      map: arrayMap,\n      fold: arrayFold,\n      filter: arrayFilter,\n      indexOf: stringOrArrayIndexOf,\n      join: arrayJoin\n    };\n\n    this.consts = {\n      E: Math.E,\n      PI: Math.PI,\n      'true': true,\n      'false': false\n    };\n  }\n\n  Parser.prototype.parse = function (expr) {\n    var instr = [];\n    var parserState = new ParserState(\n      this,\n      new TokenStream(this, expr),\n      { allowMemberAccess: this.options.allowMemberAccess }\n    );\n\n    parserState.parseExpression(instr);\n    parserState.expect(TEOF, 'EOF');\n\n    return new Expression(instr, this);\n  };\n\n  Parser.prototype.evaluate = function (expr, variables) {\n    return this.parse(expr).evaluate(variables);\n  };\n\n  var sharedParser = new Parser();\n\n  Parser.parse = function (expr) {\n    return sharedParser.parse(expr);\n  };\n\n  Parser.evaluate = function (expr, variables) {\n    return sharedParser.parse(expr).evaluate(variables);\n  };\n\n  var optionNameMap = {\n    '+': 'add',\n    '-': 'subtract',\n    '*': 'multiply',\n    '/': 'divide',\n    '%': 'remainder',\n    '^': 'power',\n    '!': 'factorial',\n    '<': 'comparison',\n    '>': 'comparison',\n    '<=': 'comparison',\n    '>=': 'comparison',\n    '==': 'comparison',\n    '!=': 'comparison',\n    '||': 'concatenate',\n    'and': 'logical',\n    'or': 'logical',\n    'not': 'logical',\n    '?': 'conditional',\n    ':': 'conditional',\n    '=': 'assignment',\n    '[': 'array',\n    '()=': 'fndef'\n  };\n\n  function getOptionName(op) {\n    return optionNameMap.hasOwnProperty(op) ? optionNameMap[op] : op;\n  }\n\n  Parser.prototype.isOperatorEnabled = function (op) {\n    var optionName = getOptionName(op);\n    var operators = this.options.operators || {};\n\n    return !(optionName in operators) || !!operators[optionName];\n  };\n\n  /*!\n   Based on ndef.parser, by Raphael Graf(r@undefined.ch)\n   http://www.undefined.ch/mparser/index.html\n\n   Ported to JavaScript and modified by Matthew Crumley (email@matthewcrumley.com, http://silentmatt.com/)\n\n   You are free to use and modify this code in anyway you find useful. Please leave this comment in the code\n   to acknowledge its original source. If you feel like it, I enjoy hearing about projects that use my code,\n   but don't feel like you have to let me know or ask permission.\n  */\n\n  // Backwards compatibility\n  var index = {\n    Parser: Parser,\n    Expression: Expression\n  };\n\n  exports.Expression = Expression;\n  exports.Parser = Parser;\n  exports.default = index;\n\n  Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n\n},{}],255:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.decorate = decorate;\nexports.tagParameter = tagParameter;\nexports.tagProperty = tagProperty;\nexports.createTaggedDecorator = createTaggedDecorator;\nconst ERROR_MSGS = __importStar(require(\"../constants/error_msgs\"));\nconst METADATA_KEY = __importStar(require(\"../constants/metadata_keys\"));\nconst js_1 = require(\"../utils/js\");\nfunction targetIsConstructorFunction(target) {\n    return target.prototype !== undefined;\n}\nfunction _throwIfMethodParameter(parameterName) {\n    if (parameterName !== undefined) {\n        throw new Error(ERROR_MSGS.INVALID_DECORATOR_OPERATION);\n    }\n}\nfunction tagParameter(annotationTarget, parameterName, parameterIndex, metadata) {\n    _throwIfMethodParameter(parameterName);\n    _tagParameterOrProperty(METADATA_KEY.TAGGED, annotationTarget, parameterIndex.toString(), metadata);\n}\nfunction tagProperty(annotationTarget, propertyName, metadata) {\n    if (targetIsConstructorFunction(annotationTarget)) {\n        throw new Error(ERROR_MSGS.INVALID_DECORATOR_OPERATION);\n    }\n    _tagParameterOrProperty(METADATA_KEY.TAGGED_PROP, annotationTarget.constructor, propertyName, metadata);\n}\nfunction _ensureNoMetadataKeyDuplicates(metadata) {\n    let metadatas = [];\n    if (Array.isArray(metadata)) {\n        metadatas = metadata;\n        const duplicate = (0, js_1.getFirstArrayDuplicate)(metadatas.map((md) => md.key));\n        if (duplicate !== undefined) {\n            throw new Error(`${ERROR_MSGS.DUPLICATED_METADATA} ${duplicate.toString()}`);\n        }\n    }\n    else {\n        metadatas = [metadata];\n    }\n    return metadatas;\n}\nfunction _tagParameterOrProperty(metadataKey, annotationTarget, key, metadata) {\n    const metadatas = _ensureNoMetadataKeyDuplicates(metadata);\n    let paramsOrPropertiesMetadata = {};\n    // read metadata if available\n    if (Reflect.hasOwnMetadata(metadataKey, annotationTarget)) {\n        paramsOrPropertiesMetadata = Reflect.getMetadata(metadataKey, annotationTarget);\n    }\n    let paramOrPropertyMetadata = paramsOrPropertiesMetadata[key];\n    if (paramOrPropertyMetadata === undefined) {\n        paramOrPropertyMetadata = [];\n    }\n    else {\n        for (const m of paramOrPropertyMetadata) {\n            if (metadatas.some((md) => md.key === m.key)) {\n                throw new Error(`${ERROR_MSGS.DUPLICATED_METADATA} ${m.key.toString()}`);\n            }\n        }\n    }\n    // set metadata\n    paramOrPropertyMetadata.push(...metadatas);\n    paramsOrPropertiesMetadata[key] = paramOrPropertyMetadata;\n    Reflect.defineMetadata(metadataKey, paramsOrPropertiesMetadata, annotationTarget);\n}\nfunction createTaggedDecorator(metadata) {\n    return (target, targetKey, indexOrPropertyDescriptor) => {\n        if (typeof indexOrPropertyDescriptor === 'number') {\n            tagParameter(target, targetKey, indexOrPropertyDescriptor, metadata);\n        }\n        else {\n            tagProperty(target, targetKey, metadata);\n        }\n    };\n}\nfunction _decorate(decorators, target) {\n    Reflect.decorate(decorators, target);\n}\nfunction _param(paramIndex, decorator) {\n    return function (target, key) {\n        decorator(target, key, paramIndex);\n    };\n}\n// Allows VanillaJS developers to use decorators:\n// decorate(injectable(), FooBar);\n// decorate(targetName('foo', 'bar'), FooBar);\n// decorate(named('foo'), FooBar, 0);\n// decorate(tagged('bar'), FooBar, 1);\nfunction decorate(decorator, target, parameterIndexOrProperty) {\n    if (typeof parameterIndexOrProperty === 'number') {\n        _decorate([_param(parameterIndexOrProperty, decorator)], target);\n    }\n    else if (typeof parameterIndexOrProperty === 'string') {\n        Reflect.decorate([decorator], target, parameterIndexOrProperty);\n    }\n    else {\n        _decorate([decorator], target);\n    }\n}\n\n},{\"../constants/error_msgs\":270,\"../constants/metadata_keys\":272,\"../utils/js\":303}],256:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.inject = void 0;\nconst METADATA_KEY = __importStar(require(\"../constants/metadata_keys\"));\nconst inject_base_1 = require(\"./inject_base\");\nconst inject = (0, inject_base_1.injectBase)(METADATA_KEY.INJECT_TAG);\nexports.inject = inject;\n\n},{\"../constants/metadata_keys\":272,\"./inject_base\":257}],257:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.injectBase = injectBase;\nconst error_msgs_1 = require(\"../constants/error_msgs\");\nconst metadata_1 = require(\"../planning/metadata\");\nconst decorator_utils_1 = require(\"./decorator_utils\");\nfunction injectBase(metadataKey) {\n    return (serviceIdentifier) => {\n        return (target, targetKey, indexOrPropertyDescriptor) => {\n            // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n            if (serviceIdentifier === undefined) {\n                const className = typeof target === 'function' ? target.name : target.constructor.name;\n                throw new Error((0, error_msgs_1.UNDEFINED_INJECT_ANNOTATION)(className));\n            }\n            (0, decorator_utils_1.createTaggedDecorator)(new metadata_1.Metadata(metadataKey, serviceIdentifier))(target, targetKey, indexOrPropertyDescriptor);\n        };\n    };\n}\n\n},{\"../constants/error_msgs\":270,\"../planning/metadata\":280,\"./decorator_utils\":255}],258:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.injectable = injectable;\nconst ERRORS_MSGS = __importStar(require(\"../constants/error_msgs\"));\nconst METADATA_KEY = __importStar(require(\"../constants/metadata_keys\"));\nfunction injectable() {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    return function (target) {\n        if (Reflect.hasOwnMetadata(METADATA_KEY.PARAM_TYPES, target)) {\n            throw new Error(ERRORS_MSGS.DUPLICATED_INJECTABLE_DECORATOR);\n        }\n        const types = Reflect.getMetadata(METADATA_KEY.DESIGN_PARAM_TYPES, target) || [];\n        Reflect.defineMetadata(METADATA_KEY.PARAM_TYPES, types, target);\n        return target;\n    };\n}\n\n},{\"../constants/error_msgs\":270,\"../constants/metadata_keys\":272}],259:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.multiInject = void 0;\nconst METADATA_KEY = __importStar(require(\"../constants/metadata_keys\"));\nconst inject_base_1 = require(\"./inject_base\");\nconst multiInject = (0, inject_base_1.injectBase)(METADATA_KEY.MULTI_INJECT_TAG);\nexports.multiInject = multiInject;\n\n},{\"../constants/metadata_keys\":272,\"./inject_base\":257}],260:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.named = named;\nconst METADATA_KEY = __importStar(require(\"../constants/metadata_keys\"));\nconst metadata_1 = require(\"../planning/metadata\");\nconst decorator_utils_1 = require(\"./decorator_utils\");\n// Used to add named metadata which is used to resolve name-based contextual bindings.\nfunction named(name) {\n    return (0, decorator_utils_1.createTaggedDecorator)(new metadata_1.Metadata(METADATA_KEY.NAMED_TAG, name));\n}\n\n},{\"../constants/metadata_keys\":272,\"../planning/metadata\":280,\"./decorator_utils\":255}],261:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.optional = optional;\nconst METADATA_KEY = __importStar(require(\"../constants/metadata_keys\"));\nconst metadata_1 = require(\"../planning/metadata\");\nconst decorator_utils_1 = require(\"./decorator_utils\");\nfunction optional() {\n    return (0, decorator_utils_1.createTaggedDecorator)(new metadata_1.Metadata(METADATA_KEY.OPTIONAL_TAG, true));\n}\n\n},{\"../constants/metadata_keys\":272,\"../planning/metadata\":280,\"./decorator_utils\":255}],262:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.postConstruct = void 0;\nconst ERRORS_MSGS = __importStar(require(\"../constants/error_msgs\"));\nconst METADATA_KEY = __importStar(require(\"../constants/metadata_keys\"));\nconst property_event_decorator_1 = require(\"./property_event_decorator\");\nconst postConstruct = (0, property_event_decorator_1.propertyEventDecorator)(METADATA_KEY.POST_CONSTRUCT, ERRORS_MSGS.MULTIPLE_POST_CONSTRUCT_METHODS);\nexports.postConstruct = postConstruct;\n\n},{\"../constants/error_msgs\":270,\"../constants/metadata_keys\":272,\"./property_event_decorator\":264}],263:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.preDestroy = void 0;\nconst ERRORS_MSGS = __importStar(require(\"../constants/error_msgs\"));\nconst METADATA_KEY = __importStar(require(\"../constants/metadata_keys\"));\nconst property_event_decorator_1 = require(\"./property_event_decorator\");\nconst preDestroy = (0, property_event_decorator_1.propertyEventDecorator)(METADATA_KEY.PRE_DESTROY, ERRORS_MSGS.MULTIPLE_PRE_DESTROY_METHODS);\nexports.preDestroy = preDestroy;\n\n},{\"../constants/error_msgs\":270,\"../constants/metadata_keys\":272,\"./property_event_decorator\":264}],264:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.propertyEventDecorator = propertyEventDecorator;\nconst metadata_1 = require(\"../planning/metadata\");\nfunction propertyEventDecorator(eventKey, errorMessage) {\n    return () => {\n        return (target, propertyKey) => {\n            const metadata = new metadata_1.Metadata(eventKey, propertyKey);\n            if (Reflect.hasOwnMetadata(eventKey, target.constructor)) {\n                throw new Error(errorMessage);\n            }\n            Reflect.defineMetadata(eventKey, metadata, target.constructor);\n        };\n    };\n}\n\n},{\"../planning/metadata\":280}],265:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.tagged = tagged;\nconst metadata_1 = require(\"../planning/metadata\");\nconst decorator_utils_1 = require(\"./decorator_utils\");\n// Used to add custom metadata which is used to resolve metadata-based contextual bindings.\nfunction tagged(metadataKey, metadataValue) {\n    return (0, decorator_utils_1.createTaggedDecorator)(new metadata_1.Metadata(metadataKey, metadataValue));\n}\n\n},{\"../planning/metadata\":280,\"./decorator_utils\":255}],266:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.targetName = targetName;\nconst METADATA_KEY = __importStar(require(\"../constants/metadata_keys\"));\nconst metadata_1 = require(\"../planning/metadata\");\nconst decorator_utils_1 = require(\"./decorator_utils\");\nfunction targetName(name) {\n    return function (target, targetKey, index) {\n        const metadata = new metadata_1.Metadata(METADATA_KEY.NAME_TAG, name);\n        (0, decorator_utils_1.tagParameter)(target, targetKey, index, metadata);\n    };\n}\n\n},{\"../constants/metadata_keys\":272,\"../planning/metadata\":280,\"./decorator_utils\":255}],267:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unmanaged = unmanaged;\nconst METADATA_KEY = __importStar(require(\"../constants/metadata_keys\"));\nconst metadata_1 = require(\"../planning/metadata\");\nconst decorator_utils_1 = require(\"./decorator_utils\");\nfunction unmanaged() {\n    return function (target, targetKey, index) {\n        const metadata = new metadata_1.Metadata(METADATA_KEY.UNMANAGED_TAG, true);\n        (0, decorator_utils_1.tagParameter)(target, targetKey, index, metadata);\n    };\n}\n\n},{\"../constants/metadata_keys\":272,\"../planning/metadata\":280,\"./decorator_utils\":255}],268:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Binding = void 0;\nconst literal_types_1 = require(\"../constants/literal_types\");\nconst id_1 = require(\"../utils/id\");\nclass Binding {\n    id;\n    moduleId;\n    // Determines weather the bindings has been already activated\n    // The activation action takes place when an instance is resolved\n    // If the scope is singleton it only happens once\n    activated;\n    // A runtime identifier because at runtime we don't have interfaces\n    serviceIdentifier;\n    // constructor from binding to or toConstructor\n    implementationType;\n    // Cache used to allow singleton scope and BindingType.ConstantValue bindings\n    cache;\n    // Cache used to allow BindingType.DynamicValue bindings\n    dynamicValue;\n    // The scope mode to be used\n    scope;\n    // The kind of binding\n    type;\n    // A factory method used in BindingType.Factory bindings\n    factory;\n    // An async factory method used in BindingType.Provider bindings\n    provider;\n    // A constraint used to limit the contexts in which this binding is applicable\n    constraint;\n    // On activation handler (invoked just before an instance is added to cache and injected)\n    onActivation;\n    // On deactivation handler (invoked just before an instance is unbinded and removed from container)\n    onDeactivation;\n    constructor(serviceIdentifier, scope) {\n        this.id = (0, id_1.id)();\n        this.activated = false;\n        this.serviceIdentifier = serviceIdentifier;\n        this.scope = scope;\n        this.type = literal_types_1.BindingTypeEnum.Invalid;\n        this.constraint = (_request) => true;\n        this.implementationType = null;\n        this.cache = null;\n        this.factory = null;\n        this.provider = null;\n        this.onActivation = null;\n        this.onDeactivation = null;\n        this.dynamicValue = null;\n    }\n    clone() {\n        const clone = new Binding(this.serviceIdentifier, this.scope);\n        clone.activated =\n            clone.scope === literal_types_1.BindingScopeEnum.Singleton ? this.activated : false;\n        clone.implementationType = this.implementationType;\n        clone.dynamicValue = this.dynamicValue;\n        clone.scope = this.scope;\n        clone.type = this.type;\n        clone.factory = this.factory;\n        clone.provider = this.provider;\n        clone.constraint = this.constraint;\n        clone.onActivation = this.onActivation;\n        clone.onDeactivation = this.onDeactivation;\n        clone.cache = this.cache;\n        return clone;\n    }\n}\nexports.Binding = Binding;\n\n},{\"../constants/literal_types\":271,\"../utils/id\":302}],269:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BindingCount = void 0;\nvar BindingCount;\n(function (BindingCount) {\n    BindingCount[BindingCount[\"MultipleBindingsAvailable\"] = 2] = \"MultipleBindingsAvailable\";\n    BindingCount[BindingCount[\"NoBindingsAvailable\"] = 0] = \"NoBindingsAvailable\";\n    BindingCount[BindingCount[\"OnlyOneBindingAvailable\"] = 1] = \"OnlyOneBindingAvailable\";\n})(BindingCount || (exports.BindingCount = BindingCount = {}));\n\n},{}],270:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.STACK_OVERFLOW = exports.CIRCULAR_DEPENDENCY_IN_FACTORY = exports.ON_DEACTIVATION_ERROR = exports.PRE_DESTROY_ERROR = exports.POST_CONSTRUCT_ERROR = exports.ASYNC_UNBIND_REQUIRED = exports.MULTIPLE_POST_CONSTRUCT_METHODS = exports.MULTIPLE_PRE_DESTROY_METHODS = exports.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK = exports.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE = exports.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE = exports.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT = exports.ARGUMENTS_LENGTH_MISMATCH = exports.INVALID_DECORATOR_OPERATION = exports.INVALID_TO_SELF_VALUE = exports.LAZY_IN_SYNC = exports.INVALID_FUNCTION_BINDING = exports.INVALID_MIDDLEWARE_RETURN = exports.NO_MORE_SNAPSHOTS_AVAILABLE = exports.INVALID_BINDING_TYPE = exports.CIRCULAR_DEPENDENCY = exports.UNDEFINED_INJECT_ANNOTATION = exports.TRYING_TO_RESOLVE_BINDINGS = exports.NOT_REGISTERED = exports.CANNOT_UNBIND = exports.AMBIGUOUS_MATCH = exports.KEY_NOT_FOUND = exports.NULL_ARGUMENT = exports.DUPLICATED_METADATA = exports.DUPLICATED_INJECTABLE_DECORATOR = void 0;\nexports.DUPLICATED_INJECTABLE_DECORATOR = 'Cannot apply @injectable decorator multiple times.';\nexports.DUPLICATED_METADATA = 'Metadata key was used more than once in a parameter:';\nexports.NULL_ARGUMENT = 'NULL argument';\nexports.KEY_NOT_FOUND = 'Key Not Found';\nexports.AMBIGUOUS_MATCH = 'Ambiguous match found for serviceIdentifier:';\nexports.CANNOT_UNBIND = 'Could not unbind serviceIdentifier:';\nexports.NOT_REGISTERED = 'No matching bindings found for serviceIdentifier:';\nconst TRYING_TO_RESOLVE_BINDINGS = (name) => `Trying to resolve bindings for \"${name}\"`;\nexports.TRYING_TO_RESOLVE_BINDINGS = TRYING_TO_RESOLVE_BINDINGS;\nconst UNDEFINED_INJECT_ANNOTATION = (name) => `@inject called with undefined this could mean that the class ${name} has ` +\n    'a circular dependency problem. You can use a LazyServiceIdentifer to ' +\n    'overcome this limitation.';\nexports.UNDEFINED_INJECT_ANNOTATION = UNDEFINED_INJECT_ANNOTATION;\nexports.CIRCULAR_DEPENDENCY = 'Circular dependency found:';\nexports.INVALID_BINDING_TYPE = 'Invalid binding type:';\nexports.NO_MORE_SNAPSHOTS_AVAILABLE = 'No snapshot available to restore.';\nexports.INVALID_MIDDLEWARE_RETURN = 'Invalid return type in middleware. Middleware must return!';\nexports.INVALID_FUNCTION_BINDING = 'Value provided to function binding must be a function!';\nconst LAZY_IN_SYNC = (key) => `You are attempting to construct ${keyToString(key)} in a synchronous way ` +\n    'but it has asynchronous dependencies.';\nexports.LAZY_IN_SYNC = LAZY_IN_SYNC;\nexports.INVALID_TO_SELF_VALUE = 'The toSelf function can only be applied when a constructor is ' +\n    'used as service identifier';\nexports.INVALID_DECORATOR_OPERATION = 'The @inject @multiInject @tagged and @named decorators ' +\n    'must be applied to the parameters of a class constructor or a class property.';\nconst ARGUMENTS_LENGTH_MISMATCH = (name) => 'The number of constructor arguments in the derived class ' +\n    `${name} must be >= than the number of constructor arguments of its base class.`;\nexports.ARGUMENTS_LENGTH_MISMATCH = ARGUMENTS_LENGTH_MISMATCH;\nexports.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT = 'Invalid Container constructor argument. Container options ' +\n    'must be an object.';\nexports.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE = 'Invalid Container option. Default scope must ' +\n    'be a string (\"singleton\" or \"transient\").';\nexports.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE = 'Invalid Container option. Auto bind injectable must ' + 'be a boolean';\nexports.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK = 'Invalid Container option. Skip base check must ' + 'be a boolean';\nexports.MULTIPLE_PRE_DESTROY_METHODS = 'Cannot apply @preDestroy decorator multiple times in the same class';\nexports.MULTIPLE_POST_CONSTRUCT_METHODS = 'Cannot apply @postConstruct decorator multiple times in the same class';\nexports.ASYNC_UNBIND_REQUIRED = 'Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)';\nconst POST_CONSTRUCT_ERROR = (clazz, errorMessage) => `@postConstruct error in class ${clazz}: ${errorMessage}`;\nexports.POST_CONSTRUCT_ERROR = POST_CONSTRUCT_ERROR;\nconst PRE_DESTROY_ERROR = (clazz, errorMessage) => `@preDestroy error in class ${clazz}: ${errorMessage}`;\nexports.PRE_DESTROY_ERROR = PRE_DESTROY_ERROR;\nconst ON_DEACTIVATION_ERROR = (clazz, errorMessage) => `onDeactivation() error in class ${clazz}: ${errorMessage}`;\nexports.ON_DEACTIVATION_ERROR = ON_DEACTIVATION_ERROR;\nconst CIRCULAR_DEPENDENCY_IN_FACTORY = (factoryType, serviceIdentifier) => `It looks like there is a circular dependency in one of the '${factoryType}' bindings. Please investigate bindings with ` +\n    `service identifier '${serviceIdentifier}'.`;\nexports.CIRCULAR_DEPENDENCY_IN_FACTORY = CIRCULAR_DEPENDENCY_IN_FACTORY;\nexports.STACK_OVERFLOW = 'Maximum call stack size exceeded';\nfunction keyToString(key) {\n    if (typeof key === 'function') {\n        return `[function/class ${key.name || '<anonymous>'}]`;\n    }\n    if (typeof key === 'symbol') {\n        return key.toString();\n    }\n    // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n    return `'${key}'`;\n}\n\n},{}],271:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TargetTypeEnum = exports.BindingTypeEnum = exports.BindingScopeEnum = void 0;\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst BindingScopeEnum = {\n    Request: 'Request',\n    Singleton: 'Singleton',\n    Transient: 'Transient',\n};\nexports.BindingScopeEnum = BindingScopeEnum;\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst BindingTypeEnum = {\n    ConstantValue: 'ConstantValue',\n    Constructor: 'Constructor',\n    DynamicValue: 'DynamicValue',\n    Factory: 'Factory',\n    Function: 'Function',\n    Instance: 'Instance',\n    Invalid: 'Invalid',\n    Provider: 'Provider',\n};\nexports.BindingTypeEnum = BindingTypeEnum;\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst TargetTypeEnum = {\n    ClassProperty: 'ClassProperty',\n    ConstructorArgument: 'ConstructorArgument',\n    Variable: 'Variable',\n};\nexports.TargetTypeEnum = TargetTypeEnum;\n\n},{}],272:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NON_CUSTOM_TAG_KEYS = exports.PRE_DESTROY = exports.POST_CONSTRUCT = exports.DESIGN_PARAM_TYPES = exports.PARAM_TYPES = exports.TAGGED_PROP = exports.TAGGED = exports.MULTI_INJECT_TAG = exports.INJECT_TAG = exports.OPTIONAL_TAG = exports.UNMANAGED_TAG = exports.NAME_TAG = exports.NAMED_TAG = void 0;\n// Used for named bindings\nexports.NAMED_TAG = 'named';\n// The name of the target at design time\nexports.NAME_TAG = 'name';\n// The for unmanaged injections (in base classes when using inheritance)\nexports.UNMANAGED_TAG = 'unmanaged';\n// The for optional injections\nexports.OPTIONAL_TAG = 'optional';\n// The type of the binding at design time\nexports.INJECT_TAG = 'inject';\n// The type of the binding at design type for multi-injections\nexports.MULTI_INJECT_TAG = 'multi_inject';\n// used to store constructor arguments tags\nexports.TAGGED = 'inversify:tagged';\n// used to store class properties tags\nexports.TAGGED_PROP = 'inversify:tagged_props';\n// used to store types to be injected\nexports.PARAM_TYPES = 'inversify:paramtypes';\n// used to access design time types\nexports.DESIGN_PARAM_TYPES = 'design:paramtypes';\n// used to identify postConstruct functions\nexports.POST_CONSTRUCT = 'post_construct';\n// used to identify preDestroy functions\nexports.PRE_DESTROY = 'pre_destroy';\nfunction getNonCustomTagKeys() {\n    return [\n        exports.INJECT_TAG,\n        exports.MULTI_INJECT_TAG,\n        exports.NAME_TAG,\n        exports.UNMANAGED_TAG,\n        exports.NAMED_TAG,\n        exports.OPTIONAL_TAG,\n    ];\n}\nexports.NON_CUSTOM_TAG_KEYS = getNonCustomTagKeys();\n\n},{}],273:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Container = void 0;\nconst binding_1 = require(\"../bindings/binding\");\nconst ERROR_MSGS = __importStar(require(\"../constants/error_msgs\"));\nconst literal_types_1 = require(\"../constants/literal_types\");\nconst METADATA_KEY = __importStar(require(\"../constants/metadata_keys\"));\nconst metadata_reader_1 = require(\"../planning/metadata_reader\");\nconst planner_1 = require(\"../planning/planner\");\nconst resolver_1 = require(\"../resolution/resolver\");\nconst binding_to_syntax_1 = require(\"../syntax/binding_to_syntax\");\nconst async_1 = require(\"../utils/async\");\nconst id_1 = require(\"../utils/id\");\nconst serialization_1 = require(\"../utils/serialization\");\nconst container_snapshot_1 = require(\"./container_snapshot\");\nconst lookup_1 = require(\"./lookup\");\nconst module_activation_store_1 = require(\"./module_activation_store\");\nclass Container {\n    id;\n    parent;\n    options;\n    _middleware;\n    _bindingDictionary;\n    _activations;\n    _deactivations;\n    _snapshots;\n    _metadataReader;\n    _moduleActivationStore;\n    constructor(containerOptions) {\n        const options = containerOptions || {};\n        if (typeof options !== 'object') {\n            throw new Error(ERROR_MSGS.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);\n        }\n        if (options.defaultScope === undefined) {\n            options.defaultScope = literal_types_1.BindingScopeEnum.Transient;\n        }\n        else if (options.defaultScope !== literal_types_1.BindingScopeEnum.Singleton &&\n            options.defaultScope !== literal_types_1.BindingScopeEnum.Transient &&\n            options.defaultScope !== literal_types_1.BindingScopeEnum.Request) {\n            throw new Error(ERROR_MSGS.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);\n        }\n        if (options.autoBindInjectable === undefined) {\n            options.autoBindInjectable = false;\n        }\n        else if (typeof options.autoBindInjectable !== 'boolean') {\n            throw new Error(ERROR_MSGS.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);\n        }\n        if (options.skipBaseClassChecks === undefined) {\n            options.skipBaseClassChecks = false;\n        }\n        else if (typeof options.skipBaseClassChecks !== 'boolean') {\n            throw new Error(ERROR_MSGS.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);\n        }\n        this.options = {\n            autoBindInjectable: options.autoBindInjectable,\n            defaultScope: options.defaultScope,\n            skipBaseClassChecks: options.skipBaseClassChecks,\n        };\n        this.id = (0, id_1.id)();\n        this._bindingDictionary = new lookup_1.Lookup();\n        this._snapshots = [];\n        this._middleware = null;\n        this._activations = new lookup_1.Lookup();\n        this._deactivations = new lookup_1.Lookup();\n        this.parent = null;\n        this._metadataReader = new metadata_reader_1.MetadataReader();\n        this._moduleActivationStore = new module_activation_store_1.ModuleActivationStore();\n    }\n    static merge(container1, container2, ...containers) {\n        const container = new Container();\n        const targetContainers = [\n            container1,\n            container2,\n            ...containers,\n        ].map((targetContainer) => (0, planner_1.getBindingDictionary)(targetContainer));\n        const bindingDictionary = (0, planner_1.getBindingDictionary)(container);\n        function copyDictionary(origin, destination) {\n            origin.traverse((_key, value) => {\n                value.forEach((binding) => {\n                    destination.add(binding.serviceIdentifier, binding.clone());\n                });\n            });\n        }\n        targetContainers.forEach((targetBindingDictionary) => {\n            copyDictionary(targetBindingDictionary, bindingDictionary);\n        });\n        return container;\n    }\n    load(...modules) {\n        // eslint-disable-next-line @typescript-eslint/typedef\n        const getHelpers = this._getContainerModuleHelpersFactory();\n        for (const currentModule of modules) {\n            // eslint-disable-next-line @typescript-eslint/typedef\n            const containerModuleHelpers = getHelpers(currentModule.id);\n            currentModule.registry(containerModuleHelpers.bindFunction, containerModuleHelpers.unbindFunction, containerModuleHelpers.isboundFunction, containerModuleHelpers.rebindFunction, containerModuleHelpers.unbindAsyncFunction, containerModuleHelpers.onActivationFunction, containerModuleHelpers.onDeactivationFunction);\n        }\n    }\n    async loadAsync(...modules) {\n        // eslint-disable-next-line @typescript-eslint/typedef\n        const getHelpers = this._getContainerModuleHelpersFactory();\n        for (const currentModule of modules) {\n            // eslint-disable-next-line @typescript-eslint/typedef\n            const containerModuleHelpers = getHelpers(currentModule.id);\n            await currentModule.registry(containerModuleHelpers.bindFunction, containerModuleHelpers.unbindFunction, containerModuleHelpers.isboundFunction, containerModuleHelpers.rebindFunction, containerModuleHelpers.unbindAsyncFunction, containerModuleHelpers.onActivationFunction, containerModuleHelpers.onDeactivationFunction);\n        }\n    }\n    unload(...modules) {\n        modules.forEach((module) => {\n            const deactivations = this._removeModuleBindings(module.id);\n            this._deactivateSingletons(deactivations);\n            this._removeModuleHandlers(module.id);\n        });\n    }\n    async unloadAsync(...modules) {\n        for (const module of modules) {\n            const deactivations = this._removeModuleBindings(module.id);\n            await this._deactivateSingletonsAsync(deactivations);\n            this._removeModuleHandlers(module.id);\n        }\n    }\n    // Registers a type binding\n    bind(serviceIdentifier) {\n        return this._bind(this._buildBinding(serviceIdentifier));\n    }\n    rebind(serviceIdentifier) {\n        this.unbind(serviceIdentifier);\n        return this.bind(serviceIdentifier);\n    }\n    async rebindAsync(serviceIdentifier) {\n        await this.unbindAsync(serviceIdentifier);\n        return this.bind(serviceIdentifier);\n    }\n    // Removes a type binding from the registry by its key\n    unbind(serviceIdentifier) {\n        if (this._bindingDictionary.hasKey(serviceIdentifier)) {\n            const bindings = this._bindingDictionary.get(serviceIdentifier);\n            this._deactivateSingletons(bindings);\n        }\n        this._removeServiceFromDictionary(serviceIdentifier);\n    }\n    async unbindAsync(serviceIdentifier) {\n        if (this._bindingDictionary.hasKey(serviceIdentifier)) {\n            const bindings = this._bindingDictionary.get(serviceIdentifier);\n            await this._deactivateSingletonsAsync(bindings);\n        }\n        this._removeServiceFromDictionary(serviceIdentifier);\n    }\n    // Removes all the type bindings from the registry\n    unbindAll() {\n        this._bindingDictionary.traverse((_key, value) => {\n            this._deactivateSingletons(value);\n        });\n        this._bindingDictionary = new lookup_1.Lookup();\n    }\n    async unbindAllAsync() {\n        const promises = [];\n        this._bindingDictionary.traverse((_key, value) => {\n            promises.push(this._deactivateSingletonsAsync(value));\n        });\n        await Promise.all(promises);\n        this._bindingDictionary = new lookup_1.Lookup();\n    }\n    onActivation(serviceIdentifier, onActivation) {\n        this._activations.add(serviceIdentifier, onActivation);\n    }\n    onDeactivation(serviceIdentifier, onDeactivation) {\n        this._deactivations.add(serviceIdentifier, onDeactivation);\n    }\n    // Allows to check if there are bindings available for serviceIdentifier\n    isBound(serviceIdentifier) {\n        let bound = this._bindingDictionary.hasKey(serviceIdentifier);\n        if (!bound && this.parent) {\n            bound = this.parent.isBound(serviceIdentifier);\n        }\n        return bound;\n    }\n    // check binding dependency only in current container\n    isCurrentBound(serviceIdentifier) {\n        return this._bindingDictionary.hasKey(serviceIdentifier);\n    }\n    isBoundNamed(serviceIdentifier, named) {\n        return this.isBoundTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);\n    }\n    // Check if a binding with a complex constraint is available without throwing a error. Ancestors are also verified.\n    isBoundTagged(serviceIdentifier, key, value) {\n        let bound = false;\n        // verify if there are bindings available for serviceIdentifier on current binding dictionary\n        if (this._bindingDictionary.hasKey(serviceIdentifier)) {\n            const bindings = this._bindingDictionary.get(serviceIdentifier);\n            const request = (0, planner_1.createMockRequest)(this, serviceIdentifier, {\n                customTag: {\n                    key,\n                    value,\n                },\n                isMultiInject: false,\n            });\n            bound = bindings.some((b) => b.constraint(request));\n        }\n        // verify if there is a parent container that could solve the request\n        if (!bound && this.parent) {\n            bound = this.parent.isBoundTagged(serviceIdentifier, key, value);\n        }\n        return bound;\n    }\n    snapshot() {\n        this._snapshots.push(container_snapshot_1.ContainerSnapshot.of(this._bindingDictionary.clone(), this._middleware, this._activations.clone(), this._deactivations.clone(), this._moduleActivationStore.clone()));\n    }\n    restore() {\n        const snapshot = this._snapshots.pop();\n        if (snapshot === undefined) {\n            throw new Error(ERROR_MSGS.NO_MORE_SNAPSHOTS_AVAILABLE);\n        }\n        this._bindingDictionary = snapshot.bindings;\n        this._activations = snapshot.activations;\n        this._deactivations = snapshot.deactivations;\n        this._middleware = snapshot.middleware;\n        this._moduleActivationStore = snapshot.moduleActivationStore;\n    }\n    createChild(containerOptions) {\n        const child = new Container(containerOptions || this.options);\n        child.parent = this;\n        return child;\n    }\n    applyMiddleware(...middlewares) {\n        const initial = this._middleware\n            ? this._middleware\n            : this._planAndResolve();\n        this._middleware = middlewares.reduce((prev, curr) => curr(prev), initial);\n    }\n    applyCustomMetadataReader(metadataReader) {\n        this._metadataReader = metadataReader;\n    }\n    // Resolves a dependency by its runtime identifier\n    // The runtime identifier must be associated with only one binding\n    // use getAll when the runtime identifier is associated with multiple bindings\n    get(serviceIdentifier) {\n        const getArgs = this._getNotAllArgs(serviceIdentifier, false, false);\n        return this._getButThrowIfAsync(getArgs);\n    }\n    async getAsync(serviceIdentifier) {\n        const getArgs = this._getNotAllArgs(serviceIdentifier, false, false);\n        return this._get(getArgs);\n    }\n    getTagged(serviceIdentifier, key, value) {\n        const getArgs = this._getNotAllArgs(serviceIdentifier, false, false, key, value);\n        return this._getButThrowIfAsync(getArgs);\n    }\n    async getTaggedAsync(serviceIdentifier, key, value) {\n        const getArgs = this._getNotAllArgs(serviceIdentifier, false, false, key, value);\n        return this._get(getArgs);\n    }\n    getNamed(serviceIdentifier, named) {\n        return this.getTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);\n    }\n    async getNamedAsync(serviceIdentifier, named) {\n        return this.getTaggedAsync(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);\n    }\n    // Resolves a dependency by its runtime identifier\n    // The runtime identifier can be associated with one or multiple bindings\n    getAll(serviceIdentifier, options) {\n        const getArgs = this._getAllArgs(serviceIdentifier, options, false);\n        return this._getButThrowIfAsync(getArgs);\n    }\n    async getAllAsync(serviceIdentifier, options) {\n        const getArgs = this._getAllArgs(serviceIdentifier, options, false);\n        return this._getAll(getArgs);\n    }\n    getAllTagged(serviceIdentifier, key, value) {\n        const getArgs = this._getNotAllArgs(serviceIdentifier, true, false, key, value);\n        return this._getButThrowIfAsync(getArgs);\n    }\n    async getAllTaggedAsync(serviceIdentifier, key, value) {\n        const getArgs = this._getNotAllArgs(serviceIdentifier, true, false, key, value);\n        return this._getAll(getArgs);\n    }\n    getAllNamed(serviceIdentifier, named) {\n        return this.getAllTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);\n    }\n    async getAllNamedAsync(serviceIdentifier, named) {\n        return this.getAllTaggedAsync(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);\n    }\n    resolve(constructorFunction) {\n        const isBound = this.isBound(constructorFunction);\n        if (!isBound) {\n            this.bind(constructorFunction).toSelf();\n        }\n        const resolved = this.get(constructorFunction);\n        if (!isBound) {\n            this.unbind(constructorFunction);\n        }\n        return resolved;\n    }\n    tryGet(serviceIdentifier) {\n        const getArgs = this._getNotAllArgs(serviceIdentifier, false, true);\n        return this._getButThrowIfAsync(getArgs);\n    }\n    async tryGetAsync(serviceIdentifier) {\n        const getArgs = this._getNotAllArgs(serviceIdentifier, false, true);\n        return this._get(getArgs);\n    }\n    tryGetTagged(serviceIdentifier, key, value) {\n        const getArgs = this._getNotAllArgs(serviceIdentifier, false, true, key, value);\n        return this._getButThrowIfAsync(getArgs);\n    }\n    async tryGetTaggedAsync(serviceIdentifier, key, value) {\n        const getArgs = this._getNotAllArgs(serviceIdentifier, false, true, key, value);\n        return this._get(getArgs);\n    }\n    tryGetNamed(serviceIdentifier, named) {\n        return this.tryGetTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);\n    }\n    async tryGetNamedAsync(serviceIdentifier, named) {\n        return this.tryGetTaggedAsync(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);\n    }\n    tryGetAll(serviceIdentifier, options) {\n        const getArgs = this._getAllArgs(serviceIdentifier, options, true);\n        return this._getButThrowIfAsync(getArgs);\n    }\n    async tryGetAllAsync(serviceIdentifier, options) {\n        const getArgs = this._getAllArgs(serviceIdentifier, options, true);\n        return this._getAll(getArgs);\n    }\n    tryGetAllTagged(serviceIdentifier, key, value) {\n        const getArgs = this._getNotAllArgs(serviceIdentifier, true, true, key, value);\n        return this._getButThrowIfAsync(getArgs);\n    }\n    async tryGetAllTaggedAsync(serviceIdentifier, key, value) {\n        const getArgs = this._getNotAllArgs(serviceIdentifier, true, true, key, value);\n        return this._getAll(getArgs);\n    }\n    tryGetAllNamed(serviceIdentifier, named) {\n        return this.tryGetAllTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);\n    }\n    async tryGetAllNamedAsync(serviceIdentifier, named) {\n        return this.tryGetAllTaggedAsync(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);\n    }\n    _preDestroy(constructor, instance) {\n        if (constructor !== undefined &&\n            Reflect.hasMetadata(METADATA_KEY.PRE_DESTROY, constructor)) {\n            const data = Reflect.getMetadata(METADATA_KEY.PRE_DESTROY, constructor);\n            return instance[data.value]?.();\n        }\n    }\n    _removeModuleHandlers(moduleId) {\n        const moduleActivationsHandlers = this._moduleActivationStore.remove(moduleId);\n        this._activations.removeIntersection(moduleActivationsHandlers.onActivations);\n        this._deactivations.removeIntersection(moduleActivationsHandlers.onDeactivations);\n    }\n    _removeModuleBindings(moduleId) {\n        return this._bindingDictionary.removeByCondition((binding) => binding.moduleId === moduleId);\n    }\n    _deactivate(binding, instance) {\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n        const constructor = instance == undefined\n            ? undefined\n            : // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n                Object.getPrototypeOf(instance).constructor;\n        try {\n            if (this._deactivations.hasKey(binding.serviceIdentifier)) {\n                const result = this._deactivateContainer(instance, this._deactivations.get(binding.serviceIdentifier).values());\n                if ((0, async_1.isPromise)(result)) {\n                    return this._handleDeactivationError(result.then(async () => this._propagateContainerDeactivationThenBindingAndPreDestroyAsync(binding, instance, constructor)), binding.serviceIdentifier);\n                }\n            }\n            const propagateDeactivationResult = this._propagateContainerDeactivationThenBindingAndPreDestroy(binding, instance, constructor);\n            if ((0, async_1.isPromise)(propagateDeactivationResult)) {\n                return this._handleDeactivationError(propagateDeactivationResult, binding.serviceIdentifier);\n            }\n        }\n        catch (ex) {\n            if (ex instanceof Error) {\n                throw new Error(ERROR_MSGS.ON_DEACTIVATION_ERROR((0, serialization_1.getServiceIdentifierAsString)(binding.serviceIdentifier), ex.message));\n            }\n        }\n    }\n    async _handleDeactivationError(asyncResult, serviceIdentifier) {\n        try {\n            await asyncResult;\n        }\n        catch (ex) {\n            if (ex instanceof Error) {\n                throw new Error(ERROR_MSGS.ON_DEACTIVATION_ERROR((0, serialization_1.getServiceIdentifierAsString)(serviceIdentifier), ex.message));\n            }\n        }\n    }\n    _deactivateContainer(instance, deactivationsIterator) {\n        let deactivation = deactivationsIterator.next();\n        while (typeof deactivation.value === 'function') {\n            const result = deactivation.value(instance);\n            if ((0, async_1.isPromise)(result)) {\n                return result.then(async () => this._deactivateContainerAsync(instance, deactivationsIterator));\n            }\n            deactivation = deactivationsIterator.next();\n        }\n    }\n    async _deactivateContainerAsync(instance, deactivationsIterator) {\n        let deactivation = deactivationsIterator.next();\n        while (typeof deactivation.value === 'function') {\n            await deactivation.value(instance);\n            deactivation = deactivationsIterator.next();\n        }\n    }\n    _getContainerModuleHelpersFactory() {\n        const getBindFunction = (moduleId) => (serviceIdentifier) => {\n            const binding = this._buildBinding(serviceIdentifier);\n            binding.moduleId = moduleId;\n            return this._bind(binding);\n        };\n        const getUnbindFunction = () => (serviceIdentifier) => {\n            this.unbind(serviceIdentifier);\n        };\n        const getUnbindAsyncFunction = () => async (serviceIdentifier) => {\n            return this.unbindAsync(serviceIdentifier);\n        };\n        const getIsboundFunction = () => (serviceIdentifier) => {\n            return this.isBound(serviceIdentifier);\n        };\n        const getRebindFunction = (moduleId) => {\n            const bind = getBindFunction(moduleId);\n            return (serviceIdentifier) => {\n                this.unbind(serviceIdentifier);\n                return bind(serviceIdentifier);\n            };\n        };\n        const getOnActivationFunction = (moduleId) => (serviceIdentifier, onActivation) => {\n            this._moduleActivationStore.addActivation(moduleId, serviceIdentifier, onActivation);\n            this.onActivation(serviceIdentifier, onActivation);\n        };\n        const getOnDeactivationFunction = (moduleId) => (serviceIdentifier, onDeactivation) => {\n            this._moduleActivationStore.addDeactivation(moduleId, serviceIdentifier, onDeactivation);\n            this.onDeactivation(serviceIdentifier, onDeactivation);\n        };\n        return (mId) => ({\n            bindFunction: getBindFunction(mId),\n            isboundFunction: getIsboundFunction(),\n            onActivationFunction: getOnActivationFunction(mId),\n            onDeactivationFunction: getOnDeactivationFunction(mId),\n            rebindFunction: getRebindFunction(mId),\n            unbindAsyncFunction: getUnbindAsyncFunction(),\n            unbindFunction: getUnbindFunction(),\n        });\n    }\n    _bind(binding) {\n        this._bindingDictionary.add(binding.serviceIdentifier, binding);\n        return new binding_to_syntax_1.BindingToSyntax(binding);\n    }\n    _buildBinding(serviceIdentifier) {\n        const scope = this.options.defaultScope || literal_types_1.BindingScopeEnum.Transient;\n        return new binding_1.Binding(serviceIdentifier, scope);\n    }\n    async _getAll(getArgs) {\n        return Promise.all(this._get(getArgs));\n    }\n    // Prepares arguments required for resolution and\n    // delegates resolution to _middleware if available\n    // otherwise it delegates resolution to _planAndResolve\n    _get(getArgs) {\n        const planAndResolveArgs = {\n            ...getArgs,\n            contextInterceptor: (context) => context,\n            targetType: literal_types_1.TargetTypeEnum.Variable,\n        };\n        if (this._middleware) {\n            const middlewareResult = this._middleware(planAndResolveArgs);\n            if (middlewareResult === undefined || middlewareResult === null) {\n                throw new Error(ERROR_MSGS.INVALID_MIDDLEWARE_RETURN);\n            }\n            return middlewareResult;\n        }\n        return this._planAndResolve()(planAndResolveArgs);\n    }\n    _getButThrowIfAsync(getArgs) {\n        const result = this._get(getArgs);\n        if ((0, async_1.isPromiseOrContainsPromise)(result)) {\n            throw new Error(ERROR_MSGS.LAZY_IN_SYNC(getArgs.serviceIdentifier));\n        }\n        return result;\n    }\n    _getAllArgs(serviceIdentifier, options, isOptional) {\n        const getAllArgs = {\n            avoidConstraints: !(options?.enforceBindingConstraints ?? false),\n            isMultiInject: true,\n            isOptional,\n            serviceIdentifier,\n        };\n        return getAllArgs;\n    }\n    _getNotAllArgs(serviceIdentifier, isMultiInject, isOptional, key, value) {\n        const getNotAllArgs = {\n            avoidConstraints: false,\n            isMultiInject,\n            isOptional,\n            key,\n            serviceIdentifier,\n            value,\n        };\n        return getNotAllArgs;\n    }\n    _getPlanMetadataFromNextArgs(args) {\n        const planMetadata = {\n            isMultiInject: args.isMultiInject,\n        };\n        if (args.key !== undefined) {\n            planMetadata.customTag = {\n                key: args.key,\n                value: args.value,\n            };\n        }\n        if (args.isOptional === true) {\n            planMetadata.isOptional = true;\n        }\n        return planMetadata;\n    }\n    // Planner creates a plan and Resolver resolves a plan\n    // one of the jobs of the Container is to links the Planner\n    // with the Resolver and that is what this function is about\n    _planAndResolve() {\n        return (args) => {\n            // create a plan\n            let context = (0, planner_1.plan)(this._metadataReader, this, args.targetType, args.serviceIdentifier, this._getPlanMetadataFromNextArgs(args), args.avoidConstraints);\n            // apply context interceptor\n            context = args.contextInterceptor(context);\n            // resolve plan\n            const result = (0, resolver_1.resolve)(context);\n            return result;\n        };\n    }\n    _deactivateIfSingleton(binding) {\n        if (!binding.activated) {\n            return;\n        }\n        if ((0, async_1.isPromise)(binding.cache)) {\n            return binding.cache.then((resolved) => this._deactivate(binding, resolved));\n        }\n        return this._deactivate(binding, binding.cache);\n    }\n    _deactivateSingletons(bindings) {\n        for (const binding of bindings) {\n            const result = this._deactivateIfSingleton(binding);\n            if ((0, async_1.isPromise)(result)) {\n                throw new Error(ERROR_MSGS.ASYNC_UNBIND_REQUIRED);\n            }\n        }\n    }\n    async _deactivateSingletonsAsync(bindings) {\n        await Promise.all(bindings.map(async (b) => this._deactivateIfSingleton(b)));\n    }\n    _propagateContainerDeactivationThenBindingAndPreDestroy(binding, instance, constructor) {\n        if (this.parent) {\n            return this._deactivate.bind(this.parent)(binding, instance);\n        }\n        else {\n            return this._bindingDeactivationAndPreDestroy(binding, instance, constructor);\n        }\n    }\n    async _propagateContainerDeactivationThenBindingAndPreDestroyAsync(binding, instance, constructor) {\n        if (this.parent) {\n            await this._deactivate.bind(this.parent)(binding, instance);\n        }\n        else {\n            await this._bindingDeactivationAndPreDestroyAsync(binding, instance, constructor);\n        }\n    }\n    _removeServiceFromDictionary(serviceIdentifier) {\n        try {\n            this._bindingDictionary.remove(serviceIdentifier);\n        }\n        catch (_e) {\n            throw new Error(`${ERROR_MSGS.CANNOT_UNBIND} ${(0, serialization_1.getServiceIdentifierAsString)(serviceIdentifier)}`);\n        }\n    }\n    _bindingDeactivationAndPreDestroy(binding, instance, constructor) {\n        if (typeof binding.onDeactivation === 'function') {\n            const result = binding.onDeactivation(instance);\n            if ((0, async_1.isPromise)(result)) {\n                return result.then(() => this._preDestroy(constructor, instance));\n            }\n        }\n        return this._preDestroy(constructor, instance);\n    }\n    async _bindingDeactivationAndPreDestroyAsync(binding, instance, constructor) {\n        if (typeof binding.onDeactivation === 'function') {\n            await binding.onDeactivation(instance);\n        }\n        await this._preDestroy(constructor, instance);\n    }\n}\nexports.Container = Container;\n\n},{\"../bindings/binding\":268,\"../constants/error_msgs\":270,\"../constants/literal_types\":271,\"../constants/metadata_keys\":272,\"../planning/metadata_reader\":281,\"../planning/planner\":283,\"../resolution/resolver\":287,\"../syntax/binding_to_syntax\":292,\"../utils/async\":296,\"../utils/id\":302,\"../utils/serialization\":304,\"./container_snapshot\":275,\"./lookup\":276,\"./module_activation_store\":277}],274:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AsyncContainerModule = exports.ContainerModule = void 0;\nconst id_1 = require(\"../utils/id\");\nclass ContainerModule {\n    id;\n    registry;\n    constructor(registry) {\n        this.id = (0, id_1.id)();\n        this.registry = registry;\n    }\n}\nexports.ContainerModule = ContainerModule;\nclass AsyncContainerModule {\n    id;\n    registry;\n    constructor(registry) {\n        this.id = (0, id_1.id)();\n        this.registry = registry;\n    }\n}\nexports.AsyncContainerModule = AsyncContainerModule;\n\n},{\"../utils/id\":302}],275:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContainerSnapshot = void 0;\nclass ContainerSnapshot {\n    bindings;\n    activations;\n    deactivations;\n    middleware;\n    moduleActivationStore;\n    static of(bindings, middleware, activations, deactivations, moduleActivationStore) {\n        const snapshot = new ContainerSnapshot();\n        snapshot.bindings = bindings;\n        snapshot.middleware = middleware;\n        snapshot.deactivations = deactivations;\n        snapshot.activations = activations;\n        snapshot.moduleActivationStore = moduleActivationStore;\n        return snapshot;\n    }\n}\nexports.ContainerSnapshot = ContainerSnapshot;\n\n},{}],276:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Lookup = void 0;\nconst ERROR_MSGS = __importStar(require(\"../constants/error_msgs\"));\nconst clonable_1 = require(\"../utils/clonable\");\nclass Lookup {\n    // dictionary used store multiple values for each key <key>\n    _map;\n    constructor() {\n        this._map = new Map();\n    }\n    getMap() {\n        return this._map;\n    }\n    // adds a new entry to _map\n    add(serviceIdentifier, value) {\n        this._checkNonNulish(serviceIdentifier);\n        if (value === null || value === undefined) {\n            throw new Error(ERROR_MSGS.NULL_ARGUMENT);\n        }\n        const entry = this._map.get(serviceIdentifier);\n        if (entry !== undefined) {\n            entry.push(value);\n        }\n        else {\n            this._map.set(serviceIdentifier, [value]);\n        }\n    }\n    // gets the value of a entry by its key (serviceIdentifier)\n    get(serviceIdentifier) {\n        this._checkNonNulish(serviceIdentifier);\n        const entry = this._map.get(serviceIdentifier);\n        if (entry !== undefined) {\n            return entry;\n        }\n        else {\n            throw new Error(ERROR_MSGS.KEY_NOT_FOUND);\n        }\n    }\n    // removes a entry from _map by its key (serviceIdentifier)\n    remove(serviceIdentifier) {\n        this._checkNonNulish(serviceIdentifier);\n        if (!this._map.delete(serviceIdentifier)) {\n            throw new Error(ERROR_MSGS.KEY_NOT_FOUND);\n        }\n    }\n    removeIntersection(lookup) {\n        this.traverse((serviceIdentifier, value) => {\n            const lookupActivations = lookup.hasKey(serviceIdentifier)\n                ? lookup.get(serviceIdentifier)\n                : undefined;\n            if (lookupActivations !== undefined) {\n                const filteredValues = value.filter((lookupValue) => !lookupActivations.some((moduleActivation) => lookupValue === moduleActivation));\n                this._setValue(serviceIdentifier, filteredValues);\n            }\n        });\n    }\n    removeByCondition(condition) {\n        const removals = [];\n        this._map.forEach((entries, key) => {\n            const updatedEntries = [];\n            for (const entry of entries) {\n                const remove = condition(entry);\n                if (remove) {\n                    removals.push(entry);\n                }\n                else {\n                    updatedEntries.push(entry);\n                }\n            }\n            this._setValue(key, updatedEntries);\n        });\n        return removals;\n    }\n    // returns true if _map contains a key (serviceIdentifier)\n    hasKey(serviceIdentifier) {\n        this._checkNonNulish(serviceIdentifier);\n        return this._map.has(serviceIdentifier);\n    }\n    // returns a new Lookup instance; note: this is not a deep clone, only Lookup related data structure (dictionary) is\n    // cloned, content remains the same\n    clone() {\n        const copy = new Lookup();\n        this._map.forEach((value, key) => {\n            value.forEach((b) => {\n                copy.add(key, (0, clonable_1.isClonable)(b) ? b.clone() : b);\n            });\n        });\n        return copy;\n    }\n    traverse(func) {\n        this._map.forEach((value, key) => {\n            func(key, value);\n        });\n    }\n    _checkNonNulish(value) {\n        if (value == null) {\n            throw new Error(ERROR_MSGS.NULL_ARGUMENT);\n        }\n    }\n    _setValue(serviceIdentifier, value) {\n        if (value.length > 0) {\n            this._map.set(serviceIdentifier, value);\n        }\n        else {\n            this._map.delete(serviceIdentifier);\n        }\n    }\n}\nexports.Lookup = Lookup;\n\n},{\"../constants/error_msgs\":270,\"../utils/clonable\":298}],277:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ModuleActivationStore = void 0;\nconst lookup_1 = require(\"./lookup\");\nclass ModuleActivationStore {\n    _map = new Map();\n    remove(moduleId) {\n        const handlers = this._map.get(moduleId);\n        if (handlers === undefined) {\n            return this._getEmptyHandlersStore();\n        }\n        this._map.delete(moduleId);\n        return handlers;\n    }\n    addDeactivation(moduleId, serviceIdentifier, onDeactivation) {\n        this._getModuleActivationHandlers(moduleId).onDeactivations.add(serviceIdentifier, onDeactivation);\n    }\n    addActivation(moduleId, serviceIdentifier, onActivation) {\n        this._getModuleActivationHandlers(moduleId).onActivations.add(serviceIdentifier, onActivation);\n    }\n    clone() {\n        const clone = new ModuleActivationStore();\n        this._map.forEach((handlersStore, moduleId) => {\n            clone._map.set(moduleId, {\n                onActivations: handlersStore.onActivations.clone(),\n                onDeactivations: handlersStore.onDeactivations.clone(),\n            });\n        });\n        return clone;\n    }\n    _getModuleActivationHandlers(moduleId) {\n        let moduleActivationHandlers = this._map.get(moduleId);\n        if (moduleActivationHandlers === undefined) {\n            moduleActivationHandlers = this._getEmptyHandlersStore();\n            this._map.set(moduleId, moduleActivationHandlers);\n        }\n        return moduleActivationHandlers;\n    }\n    _getEmptyHandlersStore() {\n        const handlersStore = {\n            onActivations: new lookup_1.Lookup(),\n            onDeactivations: new lookup_1.Lookup(),\n        };\n        return handlersStore;\n    }\n}\nexports.ModuleActivationStore = ModuleActivationStore;\n\n},{\"./lookup\":276}],278:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.multiBindToService = exports.getServiceIdentifierAsString = exports.typeConstraint = exports.namedConstraint = exports.taggedConstraint = exports.traverseAncerstors = exports.decorate = exports.id = exports.MetadataReader = exports.preDestroy = exports.postConstruct = exports.targetName = exports.multiInject = exports.unmanaged = exports.optional = exports.inject = exports.named = exports.tagged = exports.injectable = exports.createTaggedDecorator = exports.ContainerModule = exports.AsyncContainerModule = exports.TargetTypeEnum = exports.BindingTypeEnum = exports.BindingScopeEnum = exports.Container = exports.METADATA_KEY = exports.LazyServiceIdentifer = exports.LazyServiceIdentifier = void 0;\n/* eslint-disable @typescript-eslint/naming-convention */\nrequire(\"reflect-metadata\");\nconst common_1 = require(\"@inversifyjs/common\");\nconst keys = __importStar(require(\"./constants/metadata_keys\"));\nvar common_2 = require(\"@inversifyjs/common\");\nObject.defineProperty(exports, \"LazyServiceIdentifier\", { enumerable: true, get: function () { return common_2.LazyServiceIdentifier; } });\n/**\n * @deprecated Use LazyServiceIdentifier instead\n */\nexports.LazyServiceIdentifer = common_1.LazyServiceIdentifier;\n// eslint-disable-next-line @typescript-eslint/typedef\nexports.METADATA_KEY = keys;\nvar container_1 = require(\"./container/container\");\nObject.defineProperty(exports, \"Container\", { enumerable: true, get: function () { return container_1.Container; } });\nvar literal_types_1 = require(\"./constants/literal_types\");\nObject.defineProperty(exports, \"BindingScopeEnum\", { enumerable: true, get: function () { return literal_types_1.BindingScopeEnum; } });\nObject.defineProperty(exports, \"BindingTypeEnum\", { enumerable: true, get: function () { return literal_types_1.BindingTypeEnum; } });\nObject.defineProperty(exports, \"TargetTypeEnum\", { enumerable: true, get: function () { return literal_types_1.TargetTypeEnum; } });\nvar container_module_1 = require(\"./container/container_module\");\nObject.defineProperty(exports, \"AsyncContainerModule\", { enumerable: true, get: function () { return container_module_1.AsyncContainerModule; } });\nObject.defineProperty(exports, \"ContainerModule\", { enumerable: true, get: function () { return container_module_1.ContainerModule; } });\nvar decorator_utils_1 = require(\"./annotation/decorator_utils\");\nObject.defineProperty(exports, \"createTaggedDecorator\", { enumerable: true, get: function () { return decorator_utils_1.createTaggedDecorator; } });\nvar injectable_1 = require(\"./annotation/injectable\");\nObject.defineProperty(exports, \"injectable\", { enumerable: true, get: function () { return injectable_1.injectable; } });\nvar tagged_1 = require(\"./annotation/tagged\");\nObject.defineProperty(exports, \"tagged\", { enumerable: true, get: function () { return tagged_1.tagged; } });\nvar named_1 = require(\"./annotation/named\");\nObject.defineProperty(exports, \"named\", { enumerable: true, get: function () { return named_1.named; } });\nvar inject_1 = require(\"./annotation/inject\");\nObject.defineProperty(exports, \"inject\", { enumerable: true, get: function () { return inject_1.inject; } });\nvar optional_1 = require(\"./annotation/optional\");\nObject.defineProperty(exports, \"optional\", { enumerable: true, get: function () { return optional_1.optional; } });\nvar unmanaged_1 = require(\"./annotation/unmanaged\");\nObject.defineProperty(exports, \"unmanaged\", { enumerable: true, get: function () { return unmanaged_1.unmanaged; } });\nvar multi_inject_1 = require(\"./annotation/multi_inject\");\nObject.defineProperty(exports, \"multiInject\", { enumerable: true, get: function () { return multi_inject_1.multiInject; } });\nvar target_name_1 = require(\"./annotation/target_name\");\nObject.defineProperty(exports, \"targetName\", { enumerable: true, get: function () { return target_name_1.targetName; } });\nvar post_construct_1 = require(\"./annotation/post_construct\");\nObject.defineProperty(exports, \"postConstruct\", { enumerable: true, get: function () { return post_construct_1.postConstruct; } });\nvar pre_destroy_1 = require(\"./annotation/pre_destroy\");\nObject.defineProperty(exports, \"preDestroy\", { enumerable: true, get: function () { return pre_destroy_1.preDestroy; } });\nvar metadata_reader_1 = require(\"./planning/metadata_reader\");\nObject.defineProperty(exports, \"MetadataReader\", { enumerable: true, get: function () { return metadata_reader_1.MetadataReader; } });\nvar id_1 = require(\"./utils/id\");\nObject.defineProperty(exports, \"id\", { enumerable: true, get: function () { return id_1.id; } });\nvar decorator_utils_2 = require(\"./annotation/decorator_utils\");\nObject.defineProperty(exports, \"decorate\", { enumerable: true, get: function () { return decorator_utils_2.decorate; } });\nvar constraint_helpers_1 = require(\"./syntax/constraint_helpers\");\nObject.defineProperty(exports, \"traverseAncerstors\", { enumerable: true, get: function () { return constraint_helpers_1.traverseAncerstors; } });\nObject.defineProperty(exports, \"taggedConstraint\", { enumerable: true, get: function () { return constraint_helpers_1.taggedConstraint; } });\nObject.defineProperty(exports, \"namedConstraint\", { enumerable: true, get: function () { return constraint_helpers_1.namedConstraint; } });\nObject.defineProperty(exports, \"typeConstraint\", { enumerable: true, get: function () { return constraint_helpers_1.typeConstraint; } });\nvar serialization_1 = require(\"./utils/serialization\");\nObject.defineProperty(exports, \"getServiceIdentifierAsString\", { enumerable: true, get: function () { return serialization_1.getServiceIdentifierAsString; } });\nvar binding_utils_1 = require(\"./utils/binding_utils\");\nObject.defineProperty(exports, \"multiBindToService\", { enumerable: true, get: function () { return binding_utils_1.multiBindToService; } });\n\n},{\"./annotation/decorator_utils\":255,\"./annotation/inject\":256,\"./annotation/injectable\":258,\"./annotation/multi_inject\":259,\"./annotation/named\":260,\"./annotation/optional\":261,\"./annotation/post_construct\":262,\"./annotation/pre_destroy\":263,\"./annotation/tagged\":265,\"./annotation/target_name\":266,\"./annotation/unmanaged\":267,\"./constants/literal_types\":271,\"./constants/metadata_keys\":272,\"./container/container\":273,\"./container/container_module\":274,\"./planning/metadata_reader\":281,\"./syntax/constraint_helpers\":295,\"./utils/binding_utils\":297,\"./utils/id\":302,\"./utils/serialization\":304,\"@inversifyjs/common\":1,\"reflect-metadata\":305}],279:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Context = void 0;\nconst id_1 = require(\"../utils/id\");\nclass Context {\n    id;\n    container;\n    plan;\n    currentRequest;\n    constructor(container) {\n        this.id = (0, id_1.id)();\n        this.container = container;\n    }\n    addPlan(plan) {\n        this.plan = plan;\n    }\n    setCurrentRequest(currentRequest) {\n        this.currentRequest = currentRequest;\n    }\n}\nexports.Context = Context;\n\n},{\"../utils/id\":302}],280:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Metadata = void 0;\nconst METADATA_KEY = __importStar(require(\"../constants/metadata_keys\"));\nclass Metadata {\n    key;\n    value;\n    constructor(key, value) {\n        this.key = key;\n        this.value = value;\n    }\n    toString() {\n        if (this.key === METADATA_KEY.NAMED_TAG) {\n            return `named: ${String(this.value).toString()} `;\n        }\n        else {\n            return `tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`;\n        }\n    }\n}\nexports.Metadata = Metadata;\n\n},{\"../constants/metadata_keys\":272}],281:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MetadataReader = void 0;\nconst METADATA_KEY = __importStar(require(\"../constants/metadata_keys\"));\nclass MetadataReader {\n    getConstructorMetadata(constructorFunc) {\n        // TypeScript compiler generated annotations\n        const compilerGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.DESIGN_PARAM_TYPES, constructorFunc) ?? [];\n        // User generated constructor annotations\n        const userGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.TAGGED, constructorFunc);\n        return {\n            compilerGeneratedMetadata,\n            userGeneratedMetadata: userGeneratedMetadata ?? {},\n        };\n    }\n    getPropertiesMetadata(constructorFunc) {\n        // User generated properties annotations\n        const userGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.TAGGED_PROP, constructorFunc) ?? {};\n        return userGeneratedMetadata;\n    }\n}\nexports.MetadataReader = MetadataReader;\n\n},{\"../constants/metadata_keys\":272}],282:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Plan = void 0;\nclass Plan {\n    parentContext;\n    rootRequest;\n    constructor(parentContext, rootRequest) {\n        this.parentContext = parentContext;\n        this.rootRequest = rootRequest;\n    }\n}\nexports.Plan = Plan;\n\n},{}],283:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getBindingDictionary = getBindingDictionary;\nexports.plan = plan;\nexports.createMockRequest = createMockRequest;\nconst core_1 = require(\"@inversifyjs/core\");\nconst binding_count_1 = require(\"../bindings/binding_count\");\nconst ERROR_MSGS = __importStar(require(\"../constants/error_msgs\"));\nconst literal_types_1 = require(\"../constants/literal_types\");\nconst METADATA_KEY = __importStar(require(\"../constants/metadata_keys\"));\nconst exceptions_1 = require(\"../utils/exceptions\");\nconst serialization_1 = require(\"../utils/serialization\");\nconst context_1 = require(\"./context\");\nconst metadata_1 = require(\"./metadata\");\nconst plan_1 = require(\"./plan\");\nconst reflection_utils_1 = require(\"./reflection_utils\");\nconst request_1 = require(\"./request\");\nfunction getBindingDictionary(cntnr) {\n    return cntnr._bindingDictionary;\n}\nfunction _createTarget(targetType, serviceIdentifier, metadata) {\n    const metadataList = _getTargetMetadata(serviceIdentifier, metadata);\n    const classElementMetadata = (0, core_1.getClassElementMetadataFromLegacyMetadata)(metadataList);\n    if (classElementMetadata.kind === core_1.ClassElementMetadataKind.unmanaged) {\n        throw new Error('Unexpected metadata when creating target');\n    }\n    const target = new core_1.LegacyTargetImpl('', classElementMetadata, targetType);\n    return target;\n}\nfunction _getActiveBindings(metadataReader, avoidConstraints, context, parentRequest, target) {\n    let bindings = getBindings(context.container, target.serviceIdentifier);\n    let activeBindings = [];\n    // automatic binding\n    if (bindings.length === binding_count_1.BindingCount.NoBindingsAvailable &&\n        context.container.options.autoBindInjectable === true &&\n        typeof target.serviceIdentifier === 'function' &&\n        metadataReader.getConstructorMetadata(target.serviceIdentifier)\n            .compilerGeneratedMetadata) {\n        context.container.bind(target.serviceIdentifier).toSelf();\n        bindings = getBindings(context.container, target.serviceIdentifier);\n    }\n    // multiple bindings available\n    if (!avoidConstraints) {\n        // apply constraints if available to reduce the number of active bindings\n        activeBindings = bindings.filter((binding) => {\n            const request = new request_1.Request(binding.serviceIdentifier, context, parentRequest, binding, target);\n            return binding.constraint(request);\n        });\n    }\n    else {\n        // simple injection or multi-injection without constraints\n        activeBindings = bindings;\n    }\n    // validate active bindings\n    _validateActiveBindingCount(target.serviceIdentifier, activeBindings, parentRequest, target, context.container);\n    return activeBindings;\n}\nfunction _getTargetMetadata(serviceIdentifier, metadata) {\n    const metadataKey = metadata.isMultiInject\n        ? METADATA_KEY.MULTI_INJECT_TAG\n        : METADATA_KEY.INJECT_TAG;\n    const metadataList = [\n        new metadata_1.Metadata(metadataKey, serviceIdentifier),\n    ];\n    if (metadata.customTag !== undefined) {\n        metadataList.push(new metadata_1.Metadata(metadata.customTag.key, metadata.customTag.value));\n    }\n    if (metadata.isOptional === true) {\n        metadataList.push(new metadata_1.Metadata(METADATA_KEY.OPTIONAL_TAG, true));\n    }\n    return metadataList;\n}\nfunction _validateActiveBindingCount(serviceIdentifier, bindings, parentRequest, target, container) {\n    switch (bindings.length) {\n        case binding_count_1.BindingCount.NoBindingsAvailable:\n            if (target.isOptional()) {\n                return bindings;\n            }\n            else {\n                const serviceIdentifierString = (0, serialization_1.getServiceIdentifierAsString)(serviceIdentifier);\n                let msg = ERROR_MSGS.NOT_REGISTERED;\n                msg += (0, serialization_1.listMetadataForTarget)(serviceIdentifierString, target);\n                msg += (0, serialization_1.listRegisteredBindingsForServiceIdentifier)(container, serviceIdentifierString, getBindings);\n                if (parentRequest !== null) {\n                    msg += `\\n${ERROR_MSGS.TRYING_TO_RESOLVE_BINDINGS((0, serialization_1.getServiceIdentifierAsString)(parentRequest.serviceIdentifier))}`;\n                }\n                throw new Error(msg);\n            }\n        case binding_count_1.BindingCount.OnlyOneBindingAvailable:\n            return bindings;\n        case binding_count_1.BindingCount.MultipleBindingsAvailable:\n        default:\n            if (!target.isArray()) {\n                const serviceIdentifierString = (0, serialization_1.getServiceIdentifierAsString)(serviceIdentifier);\n                let msg = `${ERROR_MSGS.AMBIGUOUS_MATCH} ${serviceIdentifierString}`;\n                msg += (0, serialization_1.listRegisteredBindingsForServiceIdentifier)(container, serviceIdentifierString, getBindings);\n                throw new Error(msg);\n            }\n            else {\n                return bindings;\n            }\n    }\n}\nfunction _createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, parentRequest, target) {\n    let activeBindings;\n    let childRequest;\n    if (parentRequest === null) {\n        activeBindings = _getActiveBindings(metadataReader, avoidConstraints, context, null, target);\n        childRequest = new request_1.Request(serviceIdentifier, context, null, activeBindings, target);\n        const thePlan = new plan_1.Plan(context, childRequest);\n        context.addPlan(thePlan);\n    }\n    else {\n        activeBindings = _getActiveBindings(metadataReader, avoidConstraints, context, parentRequest, target);\n        childRequest = parentRequest.addChildRequest(target.serviceIdentifier, activeBindings, target);\n    }\n    activeBindings.forEach((binding) => {\n        let subChildRequest = null;\n        if (target.isArray()) {\n            subChildRequest = childRequest.addChildRequest(binding.serviceIdentifier, binding, target);\n        }\n        else {\n            if (binding.cache !== null) {\n                return;\n            }\n            subChildRequest = childRequest;\n        }\n        if (binding.type === literal_types_1.BindingTypeEnum.Instance &&\n            binding.implementationType !== null) {\n            const dependencies = (0, reflection_utils_1.getDependencies)(metadataReader, binding.implementationType);\n            if (context.container.options.skipBaseClassChecks !== true) {\n                // Throw if a derived class does not implement its constructor explicitly\n                // We do this to prevent errors when a base class (parent) has dependencies\n                // and one of the derived classes (children) has no dependencies\n                const baseClassDependencyCount = (0, reflection_utils_1.getBaseClassDependencyCount)(metadataReader, binding.implementationType);\n                if (dependencies.length < baseClassDependencyCount) {\n                    const error = ERROR_MSGS.ARGUMENTS_LENGTH_MISMATCH((0, reflection_utils_1.getFunctionName)(binding.implementationType));\n                    throw new Error(error);\n                }\n            }\n            dependencies.forEach((dependency) => {\n                _createSubRequests(metadataReader, false, dependency.serviceIdentifier, context, subChildRequest, dependency);\n            });\n        }\n    });\n}\nfunction getBindings(container, serviceIdentifier) {\n    let bindings = [];\n    const bindingDictionary = getBindingDictionary(container);\n    if (bindingDictionary.hasKey(serviceIdentifier)) {\n        bindings = bindingDictionary.get(serviceIdentifier);\n    }\n    else if (container.parent !== null) {\n        // recursively try to get bindings from parent container\n        bindings = getBindings(container.parent, serviceIdentifier);\n    }\n    return bindings;\n}\nfunction plan(metadataReader, container, targetType, serviceIdentifier, metadata, avoidConstraints = false) {\n    const context = new context_1.Context(container);\n    const target = _createTarget(targetType, serviceIdentifier, metadata);\n    try {\n        _createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, null, target);\n        return context;\n    }\n    catch (error) {\n        if ((0, exceptions_1.isStackOverflowException)(error)) {\n            (0, serialization_1.circularDependencyToException)(context.plan.rootRequest);\n        }\n        throw error;\n    }\n}\nfunction createMockRequest(container, serviceIdentifier, metadata) {\n    const metadataList = _getTargetMetadata(serviceIdentifier, metadata);\n    const classElementMetadata = (0, core_1.getClassElementMetadataFromLegacyMetadata)(metadataList);\n    if (classElementMetadata.kind === core_1.ClassElementMetadataKind.unmanaged) {\n        throw new Error('Unexpected metadata when creating target');\n    }\n    const target = new core_1.LegacyTargetImpl('', classElementMetadata, 'Variable');\n    const context = new context_1.Context(container);\n    const request = new request_1.Request(serviceIdentifier, context, null, [], target);\n    return request;\n}\n\n},{\"../bindings/binding_count\":269,\"../constants/error_msgs\":270,\"../constants/literal_types\":271,\"../constants/metadata_keys\":272,\"../utils/exceptions\":299,\"../utils/serialization\":304,\"./context\":279,\"./metadata\":280,\"./plan\":282,\"./reflection_utils\":284,\"./request\":285,\"@inversifyjs/core\":6}],284:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getFunctionName = void 0;\nexports.getDependencies = getDependencies;\nexports.getBaseClassDependencyCount = getBaseClassDependencyCount;\nconst core_1 = require(\"@inversifyjs/core\");\nconst METADATA_KEY = __importStar(require(\"../constants/metadata_keys\"));\nconst get_base_type_1 = require(\"../utils/get_base_type\");\nconst serialization_1 = require(\"../utils/serialization\");\nObject.defineProperty(exports, \"getFunctionName\", { enumerable: true, get: function () { return serialization_1.getFunctionName; } });\nfunction getDependencies(metadataReader, func) {\n    return (0, core_1.getTargets)(metadataReader)(func);\n}\nfunction getBaseClassDependencyCount(metadataReader, func) {\n    const baseConstructor = (0, get_base_type_1.getBaseType)(func);\n    if (baseConstructor === undefined || baseConstructor === Object) {\n        return 0;\n    }\n    // get targets for base class\n    const targets = (0, core_1.getTargets)(metadataReader)(baseConstructor);\n    // get unmanaged metadata\n    const metadata = targets.map((t) => t.metadata.filter((m) => m.key === METADATA_KEY.UNMANAGED_TAG));\n    // Compare the number of constructor arguments with the number of\n    // unmanaged dependencies unmanaged dependencies are not required\n    const unmanagedCount = [].concat.apply([], metadata).length;\n    const dependencyCount = targets.length - unmanagedCount;\n    if (dependencyCount > 0) {\n        return dependencyCount;\n    }\n    else {\n        return getBaseClassDependencyCount(metadataReader, baseConstructor);\n    }\n}\n\n},{\"../constants/metadata_keys\":272,\"../utils/get_base_type\":301,\"../utils/serialization\":304,\"@inversifyjs/core\":6}],285:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Request = void 0;\nconst id_1 = require(\"../utils/id\");\nclass Request {\n    id;\n    serviceIdentifier;\n    parentContext;\n    parentRequest;\n    bindings;\n    childRequests;\n    target;\n    requestScope;\n    constructor(serviceIdentifier, parentContext, parentRequest, \n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    bindings, target) {\n        this.id = (0, id_1.id)();\n        this.serviceIdentifier = serviceIdentifier;\n        this.parentContext = parentContext;\n        this.parentRequest = parentRequest;\n        this.target = target;\n        this.childRequests = [];\n        this.bindings = Array.isArray(bindings) ? bindings : [bindings];\n        // Set requestScope if Request is the root request\n        this.requestScope = parentRequest === null ? new Map() : null;\n    }\n    addChildRequest(serviceIdentifier, bindings, target) {\n        const child = new Request(serviceIdentifier, this.parentContext, this, bindings, target);\n        this.childRequests.push(child);\n        return child;\n    }\n}\nexports.Request = Request;\n\n},{\"../utils/id\":302}],286:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveInstance = resolveInstance;\nconst error_msgs_1 = require(\"../constants/error_msgs\");\nconst literal_types_1 = require(\"../constants/literal_types\");\nconst METADATA_KEY = __importStar(require(\"../constants/metadata_keys\"));\nconst async_1 = require(\"../utils/async\");\nfunction _resolveRequests(childRequests, resolveRequest) {\n    return childRequests.reduce((resolvedRequests, childRequest) => {\n        const injection = resolveRequest(childRequest);\n        const targetType = childRequest.target.type;\n        if (targetType === literal_types_1.TargetTypeEnum.ConstructorArgument) {\n            resolvedRequests.constructorInjections.push(injection);\n        }\n        else {\n            resolvedRequests.propertyRequests.push(childRequest);\n            resolvedRequests.propertyInjections.push(injection);\n        }\n        if (!resolvedRequests.isAsync) {\n            resolvedRequests.isAsync = (0, async_1.isPromiseOrContainsPromise)(injection);\n        }\n        return resolvedRequests;\n    }, {\n        constructorInjections: [],\n        isAsync: false,\n        propertyInjections: [],\n        propertyRequests: [],\n    });\n}\nfunction _createInstance(constr, childRequests, resolveRequest) {\n    let result;\n    if (childRequests.length > 0) {\n        const resolved = _resolveRequests(childRequests, resolveRequest);\n        const createInstanceWithInjectionsArg = {\n            ...resolved,\n            constr,\n        };\n        if (resolved.isAsync) {\n            result = createInstanceWithInjectionsAsync(createInstanceWithInjectionsArg);\n        }\n        else {\n            result = createInstanceWithInjections(createInstanceWithInjectionsArg);\n        }\n    }\n    else {\n        result = new constr();\n    }\n    return result;\n}\nfunction createInstanceWithInjections(args) {\n    const instance = new args.constr(...args.constructorInjections);\n    args.propertyRequests.forEach((r, index) => {\n        const property = r.target.identifier;\n        const injection = args.propertyInjections[index];\n        if (!r.target.isOptional() || injection !== undefined) {\n            instance[property] = injection;\n        }\n    });\n    return instance;\n}\nasync function createInstanceWithInjectionsAsync(args) {\n    const constructorInjections = await possiblyWaitInjections(args.constructorInjections);\n    const propertyInjections = await possiblyWaitInjections(args.propertyInjections);\n    return createInstanceWithInjections({\n        ...args,\n        constructorInjections,\n        propertyInjections,\n    });\n}\nasync function possiblyWaitInjections(possiblePromiseinjections) {\n    const injections = [];\n    for (const injection of possiblePromiseinjections) {\n        if (Array.isArray(injection)) {\n            injections.push(Promise.all(injection));\n        }\n        else {\n            injections.push(injection);\n        }\n    }\n    return Promise.all(injections);\n}\nfunction _getInstanceAfterPostConstruct(constr, result) {\n    const postConstructResult = _postConstruct(constr, result);\n    if ((0, async_1.isPromise)(postConstructResult)) {\n        return postConstructResult.then(() => result);\n    }\n    else {\n        return result;\n    }\n}\nfunction _postConstruct(constr, instance) {\n    if (Reflect.hasMetadata(METADATA_KEY.POST_CONSTRUCT, constr)) {\n        const data = Reflect.getMetadata(METADATA_KEY.POST_CONSTRUCT, constr);\n        try {\n            return instance[data.value]?.();\n        }\n        catch (e) {\n            if (e instanceof Error) {\n                throw new Error((0, error_msgs_1.POST_CONSTRUCT_ERROR)(constr.name, e.message));\n            }\n        }\n    }\n}\nfunction _validateInstanceResolution(binding, constr) {\n    if (binding.scope !== literal_types_1.BindingScopeEnum.Singleton) {\n        _throwIfHandlingDeactivation(binding, constr);\n    }\n}\nfunction _throwIfHandlingDeactivation(binding, constr) {\n    const scopeErrorMessage = `Class cannot be instantiated in ${binding.scope === literal_types_1.BindingScopeEnum.Request ? 'request' : 'transient'} scope.`;\n    if (typeof binding.onDeactivation === 'function') {\n        throw new Error((0, error_msgs_1.ON_DEACTIVATION_ERROR)(constr.name, scopeErrorMessage));\n    }\n    if (Reflect.hasMetadata(METADATA_KEY.PRE_DESTROY, constr)) {\n        throw new Error((0, error_msgs_1.PRE_DESTROY_ERROR)(constr.name, scopeErrorMessage));\n    }\n}\nfunction resolveInstance(binding, constr, childRequests, resolveRequest) {\n    _validateInstanceResolution(binding, constr);\n    const result = _createInstance(constr, childRequests, resolveRequest);\n    if ((0, async_1.isPromise)(result)) {\n        return result.then((resolvedResult) => _getInstanceAfterPostConstruct(constr, resolvedResult));\n    }\n    else {\n        return _getInstanceAfterPostConstruct(constr, result);\n    }\n}\n\n},{\"../constants/error_msgs\":270,\"../constants/literal_types\":271,\"../constants/metadata_keys\":272,\"../utils/async\":296}],287:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolve = resolve;\nconst ERROR_MSGS = __importStar(require(\"../constants/error_msgs\"));\nconst literal_types_1 = require(\"../constants/literal_types\");\nconst planner_1 = require(\"../planning/planner\");\nconst scope_1 = require(\"../scope/scope\");\nconst async_1 = require(\"../utils/async\");\nconst binding_utils_1 = require(\"../utils/binding_utils\");\nconst exceptions_1 = require(\"../utils/exceptions\");\nconst instantiation_1 = require(\"./instantiation\");\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst _resolveRequest = (requestScope) => (request) => {\n    request.parentContext.setCurrentRequest(request);\n    const bindings = request.bindings;\n    const childRequests = request.childRequests;\n    // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, @typescript-eslint/strict-boolean-expressions\n    const targetIsAnArray = request.target && request.target.isArray();\n    const targetParentIsNotAnArray = !request.parentRequest ||\n        // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, @typescript-eslint/strict-boolean-expressions\n        !request.parentRequest.target ||\n        // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, @typescript-eslint/strict-boolean-expressions\n        !request.target ||\n        !request.parentRequest.target.matchesArray(request.target.serviceIdentifier);\n    if (targetIsAnArray && targetParentIsNotAnArray) {\n        // Create an array instead of creating an instance\n        return childRequests.map((childRequest) => {\n            const resolveRequest = _resolveRequest(requestScope);\n            return resolveRequest(childRequest);\n        });\n    }\n    else {\n        if (request.target.isOptional() && bindings.length === 0) {\n            return undefined;\n        }\n        const binding = bindings[0];\n        return _resolveBinding(requestScope, request, binding);\n    }\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst _resolveFactoryFromBinding = (binding, context) => {\n    const factoryDetails = (0, binding_utils_1.getFactoryDetails)(binding);\n    return (0, exceptions_1.tryAndThrowErrorIfStackOverflow)(() => factoryDetails.factory.bind(binding)(context), () => new Error(ERROR_MSGS.CIRCULAR_DEPENDENCY_IN_FACTORY(factoryDetails.factoryType, context.currentRequest.serviceIdentifier.toString())));\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst _getResolvedFromBinding = (requestScope, request, binding) => {\n    let result;\n    const childRequests = request.childRequests;\n    (0, binding_utils_1.ensureFullyBound)(binding);\n    switch (binding.type) {\n        case literal_types_1.BindingTypeEnum.ConstantValue:\n        case literal_types_1.BindingTypeEnum.Function:\n            result = binding.cache;\n            break;\n        case literal_types_1.BindingTypeEnum.Constructor:\n            result = binding.implementationType;\n            break;\n        case literal_types_1.BindingTypeEnum.Instance:\n            result = (0, instantiation_1.resolveInstance)(binding, binding.implementationType, childRequests, _resolveRequest(requestScope));\n            break;\n        default:\n            result = _resolveFactoryFromBinding(binding, request.parentContext);\n    }\n    return result;\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst _resolveInScope = (requestScope, binding, resolveFromBinding) => {\n    let result = (0, scope_1.tryGetFromScope)(requestScope, binding);\n    if (result !== null) {\n        return result;\n    }\n    result = resolveFromBinding();\n    (0, scope_1.saveToScope)(requestScope, binding, result);\n    return result;\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst _resolveBinding = (requestScope, request, binding) => {\n    return _resolveInScope(requestScope, binding, () => {\n        let result = _getResolvedFromBinding(requestScope, request, binding);\n        if ((0, async_1.isPromise)(result)) {\n            result = result.then((resolved) => _onActivation(request, binding, resolved));\n        }\n        else {\n            result = _onActivation(request, binding, result);\n        }\n        return result;\n    });\n};\nfunction _onActivation(request, binding, resolved) {\n    let result = _bindingActivation(request.parentContext, binding, resolved);\n    const containersIterator = _getContainersIterator(request.parentContext.container);\n    let container;\n    let containersIteratorResult = containersIterator.next();\n    do {\n        container = containersIteratorResult.value;\n        const context = request.parentContext;\n        const serviceIdentifier = request.serviceIdentifier;\n        const activationsIterator = _getContainerActivationsForService(container, serviceIdentifier);\n        if ((0, async_1.isPromise)(result)) {\n            result = _activateContainerAsync(activationsIterator, context, result);\n        }\n        else {\n            result = _activateContainer(activationsIterator, context, result);\n        }\n        containersIteratorResult = containersIterator.next();\n        // make sure if we are currently on the container that owns the binding, not to keep looping down to child containers\n    } while (containersIteratorResult.done !== true &&\n        !(0, planner_1.getBindingDictionary)(container).hasKey(request.serviceIdentifier));\n    return result;\n}\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst _bindingActivation = (context, binding, previousResult) => {\n    let result;\n    // use activation handler if available\n    if (typeof binding.onActivation === 'function') {\n        result = binding.onActivation(context, previousResult);\n    }\n    else {\n        result = previousResult;\n    }\n    return result;\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst _activateContainer = (activationsIterator, context, result) => {\n    let activation = activationsIterator.next();\n    while (activation.done !== true) {\n        result = activation.value(context, result);\n        if ((0, async_1.isPromise)(result)) {\n            return _activateContainerAsync(activationsIterator, context, result);\n        }\n        activation = activationsIterator.next();\n    }\n    return result;\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst _activateContainerAsync = async (activationsIterator, context, resultPromise) => {\n    let result = await resultPromise;\n    let activation = activationsIterator.next();\n    while (activation.done !== true) {\n        result = await activation.value(context, result);\n        activation = activationsIterator.next();\n    }\n    return result;\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst _getContainerActivationsForService = (container, serviceIdentifier) => {\n    // smell accessing _activations, but similar pattern is done in planner.getBindingDictionary()\n    const activations = container._activations;\n    return activations.hasKey(serviceIdentifier)\n        ? activations.get(serviceIdentifier).values()\n        : [].values();\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst _getContainersIterator = (container) => {\n    const containersStack = [container];\n    let parent = container.parent;\n    while (parent !== null) {\n        containersStack.push(parent);\n        parent = parent.parent;\n    }\n    const getNextContainer = () => {\n        const nextContainer = containersStack.pop();\n        if (nextContainer !== undefined) {\n            return { done: false, value: nextContainer };\n        }\n        else {\n            return { done: true, value: undefined };\n        }\n    };\n    const containersIterator = {\n        next: getNextContainer,\n    };\n    return containersIterator;\n};\nfunction resolve(context) {\n    const resolveRequestFunction = _resolveRequest(context.plan.rootRequest.requestScope);\n    return resolveRequestFunction(context.plan.rootRequest);\n}\n\n},{\"../constants/error_msgs\":270,\"../constants/literal_types\":271,\"../planning/planner\":283,\"../scope/scope\":288,\"../utils/async\":296,\"../utils/binding_utils\":297,\"../utils/exceptions\":299,\"./instantiation\":286}],288:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.saveToScope = exports.tryGetFromScope = void 0;\nconst literal_types_1 = require(\"../constants/literal_types\");\nconst async_1 = require(\"../utils/async\");\nconst tryGetFromScope = (requestScope, binding) => {\n    if (binding.scope === literal_types_1.BindingScopeEnum.Singleton && binding.activated) {\n        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n        return binding.cache;\n    }\n    if (binding.scope === literal_types_1.BindingScopeEnum.Request &&\n        requestScope.has(binding.id)) {\n        return requestScope.get(binding.id);\n    }\n    return null;\n};\nexports.tryGetFromScope = tryGetFromScope;\nconst saveToScope = (requestScope, binding, result) => {\n    if (binding.scope === literal_types_1.BindingScopeEnum.Singleton) {\n        _saveToSingletonScope(binding, result);\n    }\n    if (binding.scope === literal_types_1.BindingScopeEnum.Request) {\n        _saveToRequestScope(requestScope, binding, result);\n    }\n};\nexports.saveToScope = saveToScope;\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst _saveToRequestScope = (requestScope, binding, result) => {\n    if (!requestScope.has(binding.id)) {\n        requestScope.set(binding.id, result);\n    }\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst _saveToSingletonScope = (binding, result) => {\n    // store in cache if scope is singleton\n    binding.cache = result;\n    binding.activated = true;\n    if ((0, async_1.isPromise)(result)) {\n        void _saveAsyncResultToSingletonScope(binding, result);\n    }\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst _saveAsyncResultToSingletonScope = async (binding, asyncResult) => {\n    try {\n        const result = await asyncResult;\n        binding.cache = result;\n    }\n    catch (ex) {\n        // allow binding to retry in future\n        binding.cache = null;\n        binding.activated = false;\n        throw ex;\n    }\n};\n\n},{\"../constants/literal_types\":271,\"../utils/async\":296}],289:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BindingInSyntax = void 0;\nconst literal_types_1 = require(\"../constants/literal_types\");\nconst binding_when_on_syntax_1 = require(\"./binding_when_on_syntax\");\nclass BindingInSyntax {\n    _binding;\n    constructor(binding) {\n        this._binding = binding;\n    }\n    inRequestScope() {\n        this._binding.scope = literal_types_1.BindingScopeEnum.Request;\n        return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);\n    }\n    inSingletonScope() {\n        this._binding.scope = literal_types_1.BindingScopeEnum.Singleton;\n        return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);\n    }\n    inTransientScope() {\n        this._binding.scope = literal_types_1.BindingScopeEnum.Transient;\n        return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);\n    }\n}\nexports.BindingInSyntax = BindingInSyntax;\n\n},{\"../constants/literal_types\":271,\"./binding_when_on_syntax\":293}],290:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BindingInWhenOnSyntax = void 0;\nconst binding_in_syntax_1 = require(\"./binding_in_syntax\");\nconst binding_on_syntax_1 = require(\"./binding_on_syntax\");\nconst binding_when_syntax_1 = require(\"./binding_when_syntax\");\nclass BindingInWhenOnSyntax {\n    _bindingInSyntax;\n    _bindingWhenSyntax;\n    _bindingOnSyntax;\n    _binding;\n    constructor(binding) {\n        this._binding = binding;\n        this._bindingWhenSyntax = new binding_when_syntax_1.BindingWhenSyntax(this._binding);\n        this._bindingOnSyntax = new binding_on_syntax_1.BindingOnSyntax(this._binding);\n        this._bindingInSyntax = new binding_in_syntax_1.BindingInSyntax(binding);\n    }\n    inRequestScope() {\n        return this._bindingInSyntax.inRequestScope();\n    }\n    inSingletonScope() {\n        return this._bindingInSyntax.inSingletonScope();\n    }\n    inTransientScope() {\n        return this._bindingInSyntax.inTransientScope();\n    }\n    when(constraint) {\n        return this._bindingWhenSyntax.when(constraint);\n    }\n    whenTargetNamed(name) {\n        return this._bindingWhenSyntax.whenTargetNamed(name);\n    }\n    whenTargetIsDefault() {\n        return this._bindingWhenSyntax.whenTargetIsDefault();\n    }\n    whenTargetTagged(tag, value) {\n        return this._bindingWhenSyntax.whenTargetTagged(tag, value);\n    }\n    whenInjectedInto(parent) {\n        return this._bindingWhenSyntax.whenInjectedInto(parent);\n    }\n    whenParentNamed(name) {\n        return this._bindingWhenSyntax.whenParentNamed(name);\n    }\n    whenParentTagged(tag, value) {\n        return this._bindingWhenSyntax.whenParentTagged(tag, value);\n    }\n    whenAnyAncestorIs(ancestor) {\n        return this._bindingWhenSyntax.whenAnyAncestorIs(ancestor);\n    }\n    whenNoAncestorIs(ancestor) {\n        return this._bindingWhenSyntax.whenNoAncestorIs(ancestor);\n    }\n    whenAnyAncestorNamed(name) {\n        return this._bindingWhenSyntax.whenAnyAncestorNamed(name);\n    }\n    whenAnyAncestorTagged(tag, value) {\n        return this._bindingWhenSyntax.whenAnyAncestorTagged(tag, value);\n    }\n    whenNoAncestorNamed(name) {\n        return this._bindingWhenSyntax.whenNoAncestorNamed(name);\n    }\n    whenNoAncestorTagged(tag, value) {\n        return this._bindingWhenSyntax.whenNoAncestorTagged(tag, value);\n    }\n    whenAnyAncestorMatches(constraint) {\n        return this._bindingWhenSyntax.whenAnyAncestorMatches(constraint);\n    }\n    whenNoAncestorMatches(constraint) {\n        return this._bindingWhenSyntax.whenNoAncestorMatches(constraint);\n    }\n    onActivation(handler) {\n        return this._bindingOnSyntax.onActivation(handler);\n    }\n    onDeactivation(handler) {\n        return this._bindingOnSyntax.onDeactivation(handler);\n    }\n}\nexports.BindingInWhenOnSyntax = BindingInWhenOnSyntax;\n\n},{\"./binding_in_syntax\":289,\"./binding_on_syntax\":291,\"./binding_when_syntax\":294}],291:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BindingOnSyntax = void 0;\nconst binding_when_syntax_1 = require(\"./binding_when_syntax\");\nclass BindingOnSyntax {\n    _binding;\n    constructor(binding) {\n        this._binding = binding;\n    }\n    onActivation(handler) {\n        this._binding.onActivation = handler;\n        return new binding_when_syntax_1.BindingWhenSyntax(this._binding);\n    }\n    onDeactivation(handler) {\n        this._binding.onDeactivation = handler;\n        return new binding_when_syntax_1.BindingWhenSyntax(this._binding);\n    }\n}\nexports.BindingOnSyntax = BindingOnSyntax;\n\n},{\"./binding_when_syntax\":294}],292:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BindingToSyntax = void 0;\nconst ERROR_MSGS = __importStar(require(\"../constants/error_msgs\"));\nconst literal_types_1 = require(\"../constants/literal_types\");\nconst binding_in_when_on_syntax_1 = require(\"./binding_in_when_on_syntax\");\nconst binding_when_on_syntax_1 = require(\"./binding_when_on_syntax\");\nclass BindingToSyntax {\n    // TODO: Implement an internal type `_BindingToSyntax<T>` wherein this member\n    // can be public. Let `BindingToSyntax<T>` be the presentational type that\n    // depends on it, and does not expose this member as public.\n    _binding;\n    constructor(binding) {\n        this._binding = binding;\n    }\n    to(constructor) {\n        this._binding.type = literal_types_1.BindingTypeEnum.Instance;\n        this._binding.implementationType = constructor;\n        return new binding_in_when_on_syntax_1.BindingInWhenOnSyntax(this._binding);\n    }\n    toSelf() {\n        if (typeof this._binding.serviceIdentifier !== 'function') {\n            throw new Error(ERROR_MSGS.INVALID_TO_SELF_VALUE);\n        }\n        const self = this._binding\n            .serviceIdentifier;\n        return this.to(self);\n    }\n    toConstantValue(value) {\n        this._binding.type = literal_types_1.BindingTypeEnum.ConstantValue;\n        this._binding.cache = value;\n        this._binding.dynamicValue = null;\n        this._binding.implementationType = null;\n        this._binding.scope = literal_types_1.BindingScopeEnum.Singleton;\n        return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);\n    }\n    toDynamicValue(func) {\n        this._binding.type = literal_types_1.BindingTypeEnum.DynamicValue;\n        this._binding.cache = null;\n        this._binding.dynamicValue = func;\n        this._binding.implementationType = null;\n        return new binding_in_when_on_syntax_1.BindingInWhenOnSyntax(this._binding);\n    }\n    toConstructor(constructor) {\n        this._binding.type = literal_types_1.BindingTypeEnum.Constructor;\n        this._binding.implementationType = constructor;\n        this._binding.scope = literal_types_1.BindingScopeEnum.Singleton;\n        return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);\n    }\n    toFactory(factory) {\n        this._binding.type = literal_types_1.BindingTypeEnum.Factory;\n        this._binding.factory = factory;\n        this._binding.scope = literal_types_1.BindingScopeEnum.Singleton;\n        return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);\n    }\n    toFunction(func) {\n        // toFunction is an alias of toConstantValue\n        if (typeof func !== 'function') {\n            throw new Error(ERROR_MSGS.INVALID_FUNCTION_BINDING);\n        }\n        const bindingWhenOnSyntax = this.toConstantValue(func);\n        this._binding.type = literal_types_1.BindingTypeEnum.Function;\n        this._binding.scope = literal_types_1.BindingScopeEnum.Singleton;\n        return bindingWhenOnSyntax;\n    }\n    toAutoFactory(serviceIdentifier) {\n        this._binding.type = literal_types_1.BindingTypeEnum.Factory;\n        this._binding.factory = (context) => {\n            const autofactory = () => context.container.get(serviceIdentifier);\n            return autofactory;\n        };\n        this._binding.scope = literal_types_1.BindingScopeEnum.Singleton;\n        return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);\n    }\n    toAutoNamedFactory(serviceIdentifier) {\n        this._binding.type = literal_types_1.BindingTypeEnum.Factory;\n        this._binding.factory = (context) => {\n            return (named) => context.container.getNamed(serviceIdentifier, named);\n        };\n        return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);\n    }\n    toProvider(provider) {\n        this._binding.type = literal_types_1.BindingTypeEnum.Provider;\n        this._binding.provider = provider;\n        this._binding.scope = literal_types_1.BindingScopeEnum.Singleton;\n        return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);\n    }\n    toService(service) {\n        this._binding.type = literal_types_1.BindingTypeEnum.DynamicValue;\n        // Service bindings should never ever be cached. This is just a workaround to achieve that. A better design should replace this approach.\n        Object.defineProperty(this._binding, 'cache', {\n            configurable: true,\n            enumerable: true,\n            get() {\n                return null;\n            },\n            set(_value) { },\n        });\n        this._binding.dynamicValue = (context) => {\n            try {\n                return context.container.get(service);\n            }\n            catch (_error) {\n                // This is a performance degradation in this edge case, we do need to improve the internal resolution architecture in order to solve this properly.\n                return context.container.getAsync(service);\n            }\n        };\n        this._binding.implementationType = null;\n    }\n}\nexports.BindingToSyntax = BindingToSyntax;\n\n},{\"../constants/error_msgs\":270,\"../constants/literal_types\":271,\"./binding_in_when_on_syntax\":290,\"./binding_when_on_syntax\":293}],293:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BindingWhenOnSyntax = void 0;\nconst binding_on_syntax_1 = require(\"./binding_on_syntax\");\nconst binding_when_syntax_1 = require(\"./binding_when_syntax\");\nclass BindingWhenOnSyntax {\n    _bindingWhenSyntax;\n    _bindingOnSyntax;\n    _binding;\n    constructor(binding) {\n        this._binding = binding;\n        this._bindingWhenSyntax = new binding_when_syntax_1.BindingWhenSyntax(this._binding);\n        this._bindingOnSyntax = new binding_on_syntax_1.BindingOnSyntax(this._binding);\n    }\n    when(constraint) {\n        return this._bindingWhenSyntax.when(constraint);\n    }\n    whenTargetNamed(name) {\n        return this._bindingWhenSyntax.whenTargetNamed(name);\n    }\n    whenTargetIsDefault() {\n        return this._bindingWhenSyntax.whenTargetIsDefault();\n    }\n    whenTargetTagged(tag, value) {\n        return this._bindingWhenSyntax.whenTargetTagged(tag, value);\n    }\n    whenInjectedInto(parent) {\n        return this._bindingWhenSyntax.whenInjectedInto(parent);\n    }\n    whenParentNamed(name) {\n        return this._bindingWhenSyntax.whenParentNamed(name);\n    }\n    whenParentTagged(tag, value) {\n        return this._bindingWhenSyntax.whenParentTagged(tag, value);\n    }\n    whenAnyAncestorIs(ancestor) {\n        return this._bindingWhenSyntax.whenAnyAncestorIs(ancestor);\n    }\n    whenNoAncestorIs(ancestor) {\n        return this._bindingWhenSyntax.whenNoAncestorIs(ancestor);\n    }\n    whenAnyAncestorNamed(name) {\n        return this._bindingWhenSyntax.whenAnyAncestorNamed(name);\n    }\n    whenAnyAncestorTagged(tag, value) {\n        return this._bindingWhenSyntax.whenAnyAncestorTagged(tag, value);\n    }\n    whenNoAncestorNamed(name) {\n        return this._bindingWhenSyntax.whenNoAncestorNamed(name);\n    }\n    whenNoAncestorTagged(tag, value) {\n        return this._bindingWhenSyntax.whenNoAncestorTagged(tag, value);\n    }\n    whenAnyAncestorMatches(constraint) {\n        return this._bindingWhenSyntax.whenAnyAncestorMatches(constraint);\n    }\n    whenNoAncestorMatches(constraint) {\n        return this._bindingWhenSyntax.whenNoAncestorMatches(constraint);\n    }\n    onActivation(handler) {\n        return this._bindingOnSyntax.onActivation(handler);\n    }\n    onDeactivation(handler) {\n        return this._bindingOnSyntax.onDeactivation(handler);\n    }\n}\nexports.BindingWhenOnSyntax = BindingWhenOnSyntax;\n\n},{\"./binding_on_syntax\":291,\"./binding_when_syntax\":294}],294:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BindingWhenSyntax = void 0;\nconst binding_on_syntax_1 = require(\"./binding_on_syntax\");\nconst constraint_helpers_1 = require(\"./constraint_helpers\");\nclass BindingWhenSyntax {\n    _binding;\n    constructor(binding) {\n        this._binding = binding;\n    }\n    when(constraint) {\n        this._binding.constraint = constraint;\n        return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n    }\n    whenTargetNamed(name) {\n        this._binding.constraint = (0, constraint_helpers_1.namedConstraint)(name);\n        return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n    }\n    whenTargetIsDefault() {\n        this._binding.constraint = (request) => {\n            if (request === null) {\n                return false;\n            }\n            const targetIsDefault = \n            // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n            request.target !== null &&\n                !request.target.isNamed() &&\n                !request.target.isTagged();\n            return targetIsDefault;\n        };\n        return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n    }\n    whenTargetTagged(tag, value) {\n        this._binding.constraint = (0, constraint_helpers_1.taggedConstraint)(tag)(value);\n        return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n    }\n    whenInjectedInto(parent) {\n        this._binding.constraint = (request) => request !== null && (0, constraint_helpers_1.typeConstraint)(parent)(request.parentRequest);\n        return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n    }\n    whenParentNamed(name) {\n        this._binding.constraint = (request) => request !== null && (0, constraint_helpers_1.namedConstraint)(name)(request.parentRequest);\n        return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n    }\n    whenParentTagged(tag, value) {\n        this._binding.constraint = (request) => request !== null && (0, constraint_helpers_1.taggedConstraint)(tag)(value)(request.parentRequest);\n        return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n    }\n    whenAnyAncestorIs(ancestor) {\n        this._binding.constraint = (request) => request !== null && (0, constraint_helpers_1.traverseAncerstors)(request, (0, constraint_helpers_1.typeConstraint)(ancestor));\n        return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n    }\n    whenNoAncestorIs(ancestor) {\n        this._binding.constraint = (request) => request !== null &&\n            !(0, constraint_helpers_1.traverseAncerstors)(request, (0, constraint_helpers_1.typeConstraint)(ancestor));\n        return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n    }\n    whenAnyAncestorNamed(name) {\n        this._binding.constraint = (request) => request !== null && (0, constraint_helpers_1.traverseAncerstors)(request, (0, constraint_helpers_1.namedConstraint)(name));\n        return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n    }\n    whenNoAncestorNamed(name) {\n        this._binding.constraint = (request) => request !== null && !(0, constraint_helpers_1.traverseAncerstors)(request, (0, constraint_helpers_1.namedConstraint)(name));\n        return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n    }\n    whenAnyAncestorTagged(tag, value) {\n        this._binding.constraint = (request) => request !== null &&\n            (0, constraint_helpers_1.traverseAncerstors)(request, (0, constraint_helpers_1.taggedConstraint)(tag)(value));\n        return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n    }\n    whenNoAncestorTagged(tag, value) {\n        this._binding.constraint = (request) => request !== null &&\n            !(0, constraint_helpers_1.traverseAncerstors)(request, (0, constraint_helpers_1.taggedConstraint)(tag)(value));\n        return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n    }\n    whenAnyAncestorMatches(constraint) {\n        this._binding.constraint = (request) => request !== null &&\n            (0, constraint_helpers_1.traverseAncerstors)(request, constraint);\n        return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n    }\n    whenNoAncestorMatches(constraint) {\n        this._binding.constraint = (request) => request !== null &&\n            !(0, constraint_helpers_1.traverseAncerstors)(request, constraint);\n        return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n    }\n}\nexports.BindingWhenSyntax = BindingWhenSyntax;\n\n},{\"./binding_on_syntax\":291,\"./constraint_helpers\":295}],295:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.typeConstraint = exports.namedConstraint = exports.taggedConstraint = exports.traverseAncerstors = void 0;\nconst METADATA_KEY = __importStar(require(\"../constants/metadata_keys\"));\nconst metadata_1 = require(\"../planning/metadata\");\nconst traverseAncerstors = (request, constraint) => {\n    const parent = request.parentRequest;\n    if (parent !== null) {\n        return constraint(parent) ? true : traverseAncerstors(parent, constraint);\n    }\n    else {\n        return false;\n    }\n};\nexports.traverseAncerstors = traverseAncerstors;\n// This helpers use currying to help you to generate constraints\nconst taggedConstraint = (key) => (value) => {\n    const constraint = (request) => request !== null &&\n        // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n        request.target !== null &&\n        request.target.matchesTag(key)(value);\n    constraint.metaData = new metadata_1.Metadata(key, value);\n    return constraint;\n};\nexports.taggedConstraint = taggedConstraint;\nconst namedConstraint = taggedConstraint(METADATA_KEY.NAMED_TAG);\nexports.namedConstraint = namedConstraint;\nconst typeConstraint = (type) => (request) => {\n    // Using index 0 because constraints are applied\n    // to one binding at a time (see Planner class)\n    let binding = null;\n    if (request !== null) {\n        binding = request.bindings[0];\n        if (typeof type === 'string') {\n            return binding.serviceIdentifier === type;\n        }\n        else {\n            const constructor = request.bindings[0].implementationType;\n            return type === constructor;\n        }\n    }\n    return false;\n};\nexports.typeConstraint = typeConstraint;\n\n},{\"../constants/metadata_keys\":272,\"../planning/metadata\":280}],296:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isPromise = isPromise;\nexports.isPromiseOrContainsPromise = isPromiseOrContainsPromise;\nfunction isPromise(object) {\n    const isObjectOrFunction = (typeof object === 'object' && object !== null) ||\n        typeof object === 'function';\n    return (isObjectOrFunction && typeof object.then === 'function');\n}\nfunction isPromiseOrContainsPromise(object) {\n    if (isPromise(object)) {\n        return true;\n    }\n    return Array.isArray(object) && object.some(isPromise);\n}\n\n},{}],297:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getFactoryDetails = exports.ensureFullyBound = exports.multiBindToService = void 0;\nconst ERROR_MSGS = __importStar(require(\"../constants/error_msgs\"));\nconst literal_types_1 = require(\"../constants/literal_types\");\nconst serialization_1 = require(\"../utils/serialization\");\nconst factory_type_1 = require(\"./factory_type\");\nconst multiBindToService = (container) => (service) => (...types) => {\n    types.forEach((t) => {\n        container.bind(t).toService(service);\n    });\n};\nexports.multiBindToService = multiBindToService;\nconst ensureFullyBound = (binding) => {\n    let boundValue = null;\n    // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check\n    switch (binding.type) {\n        case literal_types_1.BindingTypeEnum.ConstantValue:\n        case literal_types_1.BindingTypeEnum.Function:\n            boundValue = binding.cache;\n            break;\n        case literal_types_1.BindingTypeEnum.Constructor:\n        case literal_types_1.BindingTypeEnum.Instance:\n            boundValue = binding.implementationType;\n            break;\n        case literal_types_1.BindingTypeEnum.DynamicValue:\n            boundValue = binding.dynamicValue;\n            break;\n        case literal_types_1.BindingTypeEnum.Provider:\n            boundValue = binding.provider;\n            break;\n        case literal_types_1.BindingTypeEnum.Factory:\n            boundValue = binding.factory;\n            break;\n    }\n    if (boundValue === null) {\n        // The user probably created a binding but didn't finish it\n        // e.g. container.bind<T>('Something'); missing BindingToSyntax\n        const serviceIdentifierAsString = (0, serialization_1.getServiceIdentifierAsString)(binding.serviceIdentifier);\n        throw new Error(`${ERROR_MSGS.INVALID_BINDING_TYPE} ${serviceIdentifierAsString}`);\n    }\n};\nexports.ensureFullyBound = ensureFullyBound;\nconst getFactoryDetails = (binding) => {\n    switch (binding.type) {\n        case literal_types_1.BindingTypeEnum.Factory:\n            return { factory: binding.factory, factoryType: factory_type_1.FactoryType.Factory };\n        case literal_types_1.BindingTypeEnum.Provider:\n            return { factory: binding.provider, factoryType: factory_type_1.FactoryType.Provider };\n        case literal_types_1.BindingTypeEnum.DynamicValue:\n            return {\n                factory: binding.dynamicValue,\n                factoryType: factory_type_1.FactoryType.DynamicValue,\n            };\n        default:\n            throw new Error(`Unexpected factory type ${binding.type}`);\n    }\n};\nexports.getFactoryDetails = getFactoryDetails;\n\n},{\"../constants/error_msgs\":270,\"../constants/literal_types\":271,\"../utils/serialization\":304,\"./factory_type\":300}],298:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isClonable = isClonable;\nfunction isClonable(obj) {\n    return (typeof obj === 'object' &&\n        obj !== null &&\n        'clone' in obj &&\n        typeof obj.clone === 'function');\n}\n\n},{}],299:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.tryAndThrowErrorIfStackOverflow = void 0;\nexports.isStackOverflowException = isStackOverflowException;\nconst ERROR_MSGS = __importStar(require(\"../constants/error_msgs\"));\nfunction isStackOverflowException(error) {\n    return (error instanceof RangeError ||\n        error.message === ERROR_MSGS.STACK_OVERFLOW);\n}\nconst tryAndThrowErrorIfStackOverflow = (fn, errorCallback) => {\n    try {\n        return fn();\n    }\n    catch (error) {\n        if (isStackOverflowException(error)) {\n            throw errorCallback();\n        }\n        throw error;\n    }\n};\nexports.tryAndThrowErrorIfStackOverflow = tryAndThrowErrorIfStackOverflow;\n\n},{\"../constants/error_msgs\":270}],300:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FactoryType = void 0;\nvar FactoryType;\n(function (FactoryType) {\n    FactoryType[\"DynamicValue\"] = \"toDynamicValue\";\n    FactoryType[\"Factory\"] = \"toFactory\";\n    FactoryType[\"Provider\"] = \"toProvider\";\n})(FactoryType || (exports.FactoryType = FactoryType = {}));\n\n},{}],301:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getBaseType = getBaseType;\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nfunction getBaseType(type) {\n    const prototype = Object.getPrototypeOf(type.prototype);\n    const baseType = prototype?.constructor;\n    return baseType;\n}\n\n},{}],302:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.id = id;\nlet idCounter = 0;\nfunction id() {\n    return idCounter++;\n}\n\n},{}],303:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getFirstArrayDuplicate = getFirstArrayDuplicate;\nfunction getFirstArrayDuplicate(array) {\n    const seenValues = new Set();\n    for (const entry of array) {\n        if (seenValues.has(entry)) {\n            return entry;\n        }\n        else {\n            seenValues.add(entry);\n        }\n    }\n    return undefined;\n}\n\n},{}],304:[function(require,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n    var ownKeys = function(o) {\n        ownKeys = Object.getOwnPropertyNames || function (o) {\n            var ar = [];\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n            return ar;\n        };\n        return ownKeys(o);\n    };\n    return function (mod) {\n        if (mod && mod.__esModule) return mod;\n        var result = {};\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n        __setModuleDefault(result, mod);\n        return result;\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getFunctionName = getFunctionName;\nexports.getServiceIdentifierAsString = getServiceIdentifierAsString;\nexports.listRegisteredBindingsForServiceIdentifier = listRegisteredBindingsForServiceIdentifier;\nexports.listMetadataForTarget = listMetadataForTarget;\nexports.circularDependencyToException = circularDependencyToException;\nexports.getSymbolDescription = getSymbolDescription;\nconst ERROR_MSGS = __importStar(require(\"../constants/error_msgs\"));\nfunction getServiceIdentifierAsString(serviceIdentifier) {\n    if (typeof serviceIdentifier === 'function') {\n        return serviceIdentifier.name;\n    }\n    else if (typeof serviceIdentifier === 'symbol') {\n        return serviceIdentifier.toString();\n    }\n    else {\n        return serviceIdentifier;\n    }\n}\nfunction listRegisteredBindingsForServiceIdentifier(container, serviceIdentifier, getBindings) {\n    let registeredBindingsList = '';\n    const registeredBindings = getBindings(container, serviceIdentifier);\n    if (registeredBindings.length !== 0) {\n        registeredBindingsList = '\\nRegistered bindings:';\n        registeredBindings.forEach((binding) => {\n            // Use 'Object as name of constant value injections'\n            let name = 'Object';\n            // Use function name if available\n            if (binding.implementationType !== null) {\n                name = getFunctionName(binding.implementationType);\n            }\n            registeredBindingsList = `${registeredBindingsList}\\n ${name}`;\n            if (binding.constraint.metaData) {\n                // eslint-disable-next-line @typescript-eslint/no-base-to-string, @typescript-eslint/restrict-template-expressions\n                registeredBindingsList = `${registeredBindingsList} - ${binding.constraint.metaData}`;\n            }\n        });\n    }\n    return registeredBindingsList;\n}\nfunction alreadyDependencyChain(request, serviceIdentifier) {\n    if (request.parentRequest === null) {\n        return false;\n    }\n    else if (request.parentRequest.serviceIdentifier === serviceIdentifier) {\n        return true;\n    }\n    else {\n        return alreadyDependencyChain(request.parentRequest, serviceIdentifier);\n    }\n}\nfunction dependencyChainToString(request) {\n    function _createStringArr(req, result = []) {\n        const serviceIdentifier = getServiceIdentifierAsString(req.serviceIdentifier);\n        result.push(serviceIdentifier);\n        if (req.parentRequest !== null) {\n            return _createStringArr(req.parentRequest, result);\n        }\n        return result;\n    }\n    const stringArr = _createStringArr(request);\n    return stringArr.reverse().join(' --> ');\n}\nfunction circularDependencyToException(request) {\n    request.childRequests.forEach((childRequest) => {\n        if (alreadyDependencyChain(request, childRequest.serviceIdentifier)) {\n            const services = dependencyChainToString(childRequest);\n            throw new Error(`${ERROR_MSGS.CIRCULAR_DEPENDENCY} ${services}`);\n        }\n        else {\n            circularDependencyToException(childRequest);\n        }\n    });\n}\nfunction listMetadataForTarget(serviceIdentifierString, target) {\n    if (target.isTagged() || target.isNamed()) {\n        let m = '';\n        const namedTag = target.getNamedTag();\n        const otherTags = target.getCustomTags();\n        if (namedTag !== null) {\n            m += stringifyMetadata(namedTag) + '\\n';\n        }\n        if (otherTags !== null) {\n            otherTags.forEach((tag) => {\n                m += stringifyMetadata(tag) + '\\n';\n            });\n        }\n        return ` ${serviceIdentifierString}\\n ${serviceIdentifierString} - ${m}`;\n    }\n    else {\n        return ` ${serviceIdentifierString}`;\n    }\n}\nfunction getFunctionName(func) {\n    if (func.name != null && func.name !== '') {\n        return func.name;\n    }\n    else {\n        // eslint-disable-next-line @typescript-eslint/no-base-to-string\n        const name = func.toString();\n        const match = name.match(/^function\\s*([^\\s(]+)/);\n        return match === null\n            ? `Anonymous function: ${name}`\n            : match[1];\n    }\n}\nfunction getSymbolDescription(symbol) {\n    // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n    return symbol.toString().slice(7, -1);\n}\nfunction stringifyMetadata(metadata) {\n    return `{\"key\":\"${metadata.key.toString()}\",\"value\":\"${metadata.value.toString()}\"}`;\n}\n\n},{\"../constants/error_msgs\":270}],305:[function(require,module,exports){\n(function (global){(function (){\n/*! *****************************************************************************\nCopyright (C) Microsoft. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\nvar Reflect;\n(function (Reflect) {\n    // Metadata Proposal\n    // https://rbuckton.github.io/reflect-metadata/\n    (function (factory) {\n        var root = typeof globalThis === \"object\" ? globalThis :\n            typeof global === \"object\" ? global :\n                typeof self === \"object\" ? self :\n                    typeof this === \"object\" ? this :\n                        sloppyModeThis();\n        var exporter = makeExporter(Reflect);\n        if (typeof root.Reflect !== \"undefined\") {\n            exporter = makeExporter(root.Reflect, exporter);\n        }\n        factory(exporter, root);\n        if (typeof root.Reflect === \"undefined\") {\n            root.Reflect = Reflect;\n        }\n        function makeExporter(target, previous) {\n            return function (key, value) {\n                Object.defineProperty(target, key, { configurable: true, writable: true, value: value });\n                if (previous)\n                    previous(key, value);\n            };\n        }\n        function functionThis() {\n            try {\n                return Function(\"return this;\")();\n            }\n            catch (_) { }\n        }\n        function indirectEvalThis() {\n            try {\n                return (void 0, eval)(\"(function() { return this; })()\");\n            }\n            catch (_) { }\n        }\n        function sloppyModeThis() {\n            return functionThis() || indirectEvalThis();\n        }\n    })(function (exporter, root) {\n        var hasOwn = Object.prototype.hasOwnProperty;\n        // feature test for Symbol support\n        var supportsSymbol = typeof Symbol === \"function\";\n        var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== \"undefined\" ? Symbol.toPrimitive : \"@@toPrimitive\";\n        var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== \"undefined\" ? Symbol.iterator : \"@@iterator\";\n        var supportsCreate = typeof Object.create === \"function\"; // feature test for Object.create support\n        var supportsProto = { __proto__: [] } instanceof Array; // feature test for __proto__ support\n        var downLevel = !supportsCreate && !supportsProto;\n        var HashMap = {\n            // create an object in dictionary mode (a.k.a. \"slow\" mode in v8)\n            create: supportsCreate\n                ? function () { return MakeDictionary(Object.create(null)); }\n                : supportsProto\n                    ? function () { return MakeDictionary({ __proto__: null }); }\n                    : function () { return MakeDictionary({}); },\n            has: downLevel\n                ? function (map, key) { return hasOwn.call(map, key); }\n                : function (map, key) { return key in map; },\n            get: downLevel\n                ? function (map, key) { return hasOwn.call(map, key) ? map[key] : undefined; }\n                : function (map, key) { return map[key]; },\n        };\n        // Load global or shim versions of Map, Set, and WeakMap\n        var functionPrototype = Object.getPrototypeOf(Function);\n        var _Map = typeof Map === \"function\" && typeof Map.prototype.entries === \"function\" ? Map : CreateMapPolyfill();\n        var _Set = typeof Set === \"function\" && typeof Set.prototype.entries === \"function\" ? Set : CreateSetPolyfill();\n        var _WeakMap = typeof WeakMap === \"function\" ? WeakMap : CreateWeakMapPolyfill();\n        var registrySymbol = supportsSymbol ? Symbol.for(\"@reflect-metadata:registry\") : undefined;\n        var metadataRegistry = GetOrCreateMetadataRegistry();\n        var metadataProvider = CreateMetadataProvider(metadataRegistry);\n        /**\n         * Applies a set of decorators to a property of a target object.\n         * @param decorators An array of decorators.\n         * @param target The target object.\n         * @param propertyKey (Optional) The property key to decorate.\n         * @param attributes (Optional) The property descriptor for the target key.\n         * @remarks Decorators are applied in reverse order.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     Example = Reflect.decorate(decoratorsArray, Example);\n         *\n         *     // property (on constructor)\n         *     Reflect.decorate(decoratorsArray, Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     Reflect.decorate(decoratorsArray, Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     Object.defineProperty(Example, \"staticMethod\",\n         *         Reflect.decorate(decoratorsArray, Example, \"staticMethod\",\n         *             Object.getOwnPropertyDescriptor(Example, \"staticMethod\")));\n         *\n         *     // method (on prototype)\n         *     Object.defineProperty(Example.prototype, \"method\",\n         *         Reflect.decorate(decoratorsArray, Example.prototype, \"method\",\n         *             Object.getOwnPropertyDescriptor(Example.prototype, \"method\")));\n         *\n         */\n        function decorate(decorators, target, propertyKey, attributes) {\n            if (!IsUndefined(propertyKey)) {\n                if (!IsArray(decorators))\n                    throw new TypeError();\n                if (!IsObject(target))\n                    throw new TypeError();\n                if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))\n                    throw new TypeError();\n                if (IsNull(attributes))\n                    attributes = undefined;\n                propertyKey = ToPropertyKey(propertyKey);\n                return DecorateProperty(decorators, target, propertyKey, attributes);\n            }\n            else {\n                if (!IsArray(decorators))\n                    throw new TypeError();\n                if (!IsConstructor(target))\n                    throw new TypeError();\n                return DecorateConstructor(decorators, target);\n            }\n        }\n        exporter(\"decorate\", decorate);\n        // 4.1.2 Reflect.metadata(metadataKey, metadataValue)\n        // https://rbuckton.github.io/reflect-metadata/#reflect.metadata\n        /**\n         * A default metadata decorator factory that can be used on a class, class member, or parameter.\n         * @param metadataKey The key for the metadata entry.\n         * @param metadataValue The value for the metadata entry.\n         * @returns A decorator function.\n         * @remarks\n         * If `metadataKey` is already defined for the target and target key, the\n         * metadataValue for that key will be overwritten.\n         * @example\n         *\n         *     // constructor\n         *     @Reflect.metadata(key, value)\n         *     class Example {\n         *     }\n         *\n         *     // property (on constructor, TypeScript only)\n         *     class Example {\n         *         @Reflect.metadata(key, value)\n         *         static staticProperty;\n         *     }\n         *\n         *     // property (on prototype, TypeScript only)\n         *     class Example {\n         *         @Reflect.metadata(key, value)\n         *         property;\n         *     }\n         *\n         *     // method (on constructor)\n         *     class Example {\n         *         @Reflect.metadata(key, value)\n         *         static staticMethod() { }\n         *     }\n         *\n         *     // method (on prototype)\n         *     class Example {\n         *         @Reflect.metadata(key, value)\n         *         method() { }\n         *     }\n         *\n         */\n        function metadata(metadataKey, metadataValue) {\n            function decorator(target, propertyKey) {\n                if (!IsObject(target))\n                    throw new TypeError();\n                if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))\n                    throw new TypeError();\n                OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n            }\n            return decorator;\n        }\n        exporter(\"metadata\", metadata);\n        /**\n         * Define a unique metadata entry on the target.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param metadataValue A value that contains attached metadata.\n         * @param target The target object on which to define metadata.\n         * @param propertyKey (Optional) The property key for the target.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     Reflect.defineMetadata(\"custom:annotation\", options, Example);\n         *\n         *     // property (on constructor)\n         *     Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"method\");\n         *\n         *     // decorator factory as metadata-producing annotation.\n         *     function MyAnnotation(options): Decorator {\n         *         return (target, key?) => Reflect.defineMetadata(\"custom:annotation\", options, target, key);\n         *     }\n         *\n         */\n        function defineMetadata(metadataKey, metadataValue, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n        }\n        exporter(\"defineMetadata\", defineMetadata);\n        /**\n         * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.hasMetadata(\"custom:annotation\", Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"method\");\n         *\n         */\n        function hasMetadata(metadataKey, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryHasMetadata(metadataKey, target, propertyKey);\n        }\n        exporter(\"hasMetadata\", hasMetadata);\n        /**\n         * Gets a value indicating whether the target object has the provided metadata key defined.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n         *\n         */\n        function hasOwnMetadata(metadataKey, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);\n        }\n        exporter(\"hasOwnMetadata\", hasOwnMetadata);\n        /**\n         * Gets the metadata value for the provided metadata key on the target object or its prototype chain.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.getMetadata(\"custom:annotation\", Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"method\");\n         *\n         */\n        function getMetadata(metadataKey, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryGetMetadata(metadataKey, target, propertyKey);\n        }\n        exporter(\"getMetadata\", getMetadata);\n        /**\n         * Gets the metadata value for the provided metadata key on the target object.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n         *\n         */\n        function getOwnMetadata(metadataKey, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);\n        }\n        exporter(\"getOwnMetadata\", getOwnMetadata);\n        /**\n         * Gets the metadata keys defined on the target object or its prototype chain.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns An array of unique metadata keys.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.getMetadataKeys(Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.getMetadataKeys(Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.getMetadataKeys(Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.getMetadataKeys(Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.getMetadataKeys(Example.prototype, \"method\");\n         *\n         */\n        function getMetadataKeys(target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryMetadataKeys(target, propertyKey);\n        }\n        exporter(\"getMetadataKeys\", getMetadataKeys);\n        /**\n         * Gets the unique metadata keys defined on the target object.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns An array of unique metadata keys.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.getOwnMetadataKeys(Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.getOwnMetadataKeys(Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.getOwnMetadataKeys(Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.getOwnMetadataKeys(Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.getOwnMetadataKeys(Example.prototype, \"method\");\n         *\n         */\n        function getOwnMetadataKeys(target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryOwnMetadataKeys(target, propertyKey);\n        }\n        exporter(\"getOwnMetadataKeys\", getOwnMetadataKeys);\n        /**\n         * Deletes the metadata entry from the target object with the provided key.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns `true` if the metadata entry was found and deleted; otherwise, false.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.deleteMetadata(\"custom:annotation\", Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"method\");\n         *\n         */\n        function deleteMetadata(metadataKey, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            var provider = GetMetadataProvider(target, propertyKey, /*Create*/ false);\n            if (IsUndefined(provider))\n                return false;\n            return provider.OrdinaryDeleteMetadata(metadataKey, target, propertyKey);\n        }\n        exporter(\"deleteMetadata\", deleteMetadata);\n        function DecorateConstructor(decorators, target) {\n            for (var i = decorators.length - 1; i >= 0; --i) {\n                var decorator = decorators[i];\n                var decorated = decorator(target);\n                if (!IsUndefined(decorated) && !IsNull(decorated)) {\n                    if (!IsConstructor(decorated))\n                        throw new TypeError();\n                    target = decorated;\n                }\n            }\n            return target;\n        }\n        function DecorateProperty(decorators, target, propertyKey, descriptor) {\n            for (var i = decorators.length - 1; i >= 0; --i) {\n                var decorator = decorators[i];\n                var decorated = decorator(target, propertyKey, descriptor);\n                if (!IsUndefined(decorated) && !IsNull(decorated)) {\n                    if (!IsObject(decorated))\n                        throw new TypeError();\n                    descriptor = decorated;\n                }\n            }\n            return descriptor;\n        }\n        // 3.1.1.1 OrdinaryHasMetadata(MetadataKey, O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinaryhasmetadata\n        function OrdinaryHasMetadata(MetadataKey, O, P) {\n            var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n            if (hasOwn)\n                return true;\n            var parent = OrdinaryGetPrototypeOf(O);\n            if (!IsNull(parent))\n                return OrdinaryHasMetadata(MetadataKey, parent, P);\n            return false;\n        }\n        // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata\n        function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\n            var provider = GetMetadataProvider(O, P, /*Create*/ false);\n            if (IsUndefined(provider))\n                return false;\n            return ToBoolean(provider.OrdinaryHasOwnMetadata(MetadataKey, O, P));\n        }\n        // 3.1.3.1 OrdinaryGetMetadata(MetadataKey, O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinarygetmetadata\n        function OrdinaryGetMetadata(MetadataKey, O, P) {\n            var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n            if (hasOwn)\n                return OrdinaryGetOwnMetadata(MetadataKey, O, P);\n            var parent = OrdinaryGetPrototypeOf(O);\n            if (!IsNull(parent))\n                return OrdinaryGetMetadata(MetadataKey, parent, P);\n            return undefined;\n        }\n        // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata\n        function OrdinaryGetOwnMetadata(MetadataKey, O, P) {\n            var provider = GetMetadataProvider(O, P, /*Create*/ false);\n            if (IsUndefined(provider))\n                return;\n            return provider.OrdinaryGetOwnMetadata(MetadataKey, O, P);\n        }\n        // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata\n        function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {\n            var provider = GetMetadataProvider(O, P, /*Create*/ true);\n            provider.OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P);\n        }\n        // 3.1.6.1 OrdinaryMetadataKeys(O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinarymetadatakeys\n        function OrdinaryMetadataKeys(O, P) {\n            var ownKeys = OrdinaryOwnMetadataKeys(O, P);\n            var parent = OrdinaryGetPrototypeOf(O);\n            if (parent === null)\n                return ownKeys;\n            var parentKeys = OrdinaryMetadataKeys(parent, P);\n            if (parentKeys.length <= 0)\n                return ownKeys;\n            if (ownKeys.length <= 0)\n                return parentKeys;\n            var set = new _Set();\n            var keys = [];\n            for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {\n                var key = ownKeys_1[_i];\n                var hasKey = set.has(key);\n                if (!hasKey) {\n                    set.add(key);\n                    keys.push(key);\n                }\n            }\n            for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {\n                var key = parentKeys_1[_a];\n                var hasKey = set.has(key);\n                if (!hasKey) {\n                    set.add(key);\n                    keys.push(key);\n                }\n            }\n            return keys;\n        }\n        // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys\n        function OrdinaryOwnMetadataKeys(O, P) {\n            var provider = GetMetadataProvider(O, P, /*create*/ false);\n            if (!provider) {\n                return [];\n            }\n            return provider.OrdinaryOwnMetadataKeys(O, P);\n        }\n        // 6 ECMAScript Data Types and Values\n        // https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values\n        function Type(x) {\n            if (x === null)\n                return 1 /* Null */;\n            switch (typeof x) {\n                case \"undefined\": return 0 /* Undefined */;\n                case \"boolean\": return 2 /* Boolean */;\n                case \"string\": return 3 /* String */;\n                case \"symbol\": return 4 /* Symbol */;\n                case \"number\": return 5 /* Number */;\n                case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n                default: return 6 /* Object */;\n            }\n        }\n        // 6.1.1 The Undefined Type\n        // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-undefined-type\n        function IsUndefined(x) {\n            return x === undefined;\n        }\n        // 6.1.2 The Null Type\n        // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-null-type\n        function IsNull(x) {\n            return x === null;\n        }\n        // 6.1.5 The Symbol Type\n        // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-symbol-type\n        function IsSymbol(x) {\n            return typeof x === \"symbol\";\n        }\n        // 6.1.7 The Object Type\n        // https://tc39.github.io/ecma262/#sec-object-type\n        function IsObject(x) {\n            return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n        }\n        // 7.1 Type Conversion\n        // https://tc39.github.io/ecma262/#sec-type-conversion\n        // 7.1.1 ToPrimitive(input [, PreferredType])\n        // https://tc39.github.io/ecma262/#sec-toprimitive\n        function ToPrimitive(input, PreferredType) {\n            switch (Type(input)) {\n                case 0 /* Undefined */: return input;\n                case 1 /* Null */: return input;\n                case 2 /* Boolean */: return input;\n                case 3 /* String */: return input;\n                case 4 /* Symbol */: return input;\n                case 5 /* Number */: return input;\n            }\n            var hint = PreferredType === 3 /* String */ ? \"string\" : PreferredType === 5 /* Number */ ? \"number\" : \"default\";\n            var exoticToPrim = GetMethod(input, toPrimitiveSymbol);\n            if (exoticToPrim !== undefined) {\n                var result = exoticToPrim.call(input, hint);\n                if (IsObject(result))\n                    throw new TypeError();\n                return result;\n            }\n            return OrdinaryToPrimitive(input, hint === \"default\" ? \"number\" : hint);\n        }\n        // 7.1.1.1 OrdinaryToPrimitive(O, hint)\n        // https://tc39.github.io/ecma262/#sec-ordinarytoprimitive\n        function OrdinaryToPrimitive(O, hint) {\n            if (hint === \"string\") {\n                var toString_1 = O.toString;\n                if (IsCallable(toString_1)) {\n                    var result = toString_1.call(O);\n                    if (!IsObject(result))\n                        return result;\n                }\n                var valueOf = O.valueOf;\n                if (IsCallable(valueOf)) {\n                    var result = valueOf.call(O);\n                    if (!IsObject(result))\n                        return result;\n                }\n            }\n            else {\n                var valueOf = O.valueOf;\n                if (IsCallable(valueOf)) {\n                    var result = valueOf.call(O);\n                    if (!IsObject(result))\n                        return result;\n                }\n                var toString_2 = O.toString;\n                if (IsCallable(toString_2)) {\n                    var result = toString_2.call(O);\n                    if (!IsObject(result))\n                        return result;\n                }\n            }\n            throw new TypeError();\n        }\n        // 7.1.2 ToBoolean(argument)\n        // https://tc39.github.io/ecma262/2016/#sec-toboolean\n        function ToBoolean(argument) {\n            return !!argument;\n        }\n        // 7.1.12 ToString(argument)\n        // https://tc39.github.io/ecma262/#sec-tostring\n        function ToString(argument) {\n            return \"\" + argument;\n        }\n        // 7.1.14 ToPropertyKey(argument)\n        // https://tc39.github.io/ecma262/#sec-topropertykey\n        function ToPropertyKey(argument) {\n            var key = ToPrimitive(argument, 3 /* String */);\n            if (IsSymbol(key))\n                return key;\n            return ToString(key);\n        }\n        // 7.2 Testing and Comparison Operations\n        // https://tc39.github.io/ecma262/#sec-testing-and-comparison-operations\n        // 7.2.2 IsArray(argument)\n        // https://tc39.github.io/ecma262/#sec-isarray\n        function IsArray(argument) {\n            return Array.isArray\n                ? Array.isArray(argument)\n                : argument instanceof Object\n                    ? argument instanceof Array\n                    : Object.prototype.toString.call(argument) === \"[object Array]\";\n        }\n        // 7.2.3 IsCallable(argument)\n        // https://tc39.github.io/ecma262/#sec-iscallable\n        function IsCallable(argument) {\n            // NOTE: This is an approximation as we cannot check for [[Call]] internal method.\n            return typeof argument === \"function\";\n        }\n        // 7.2.4 IsConstructor(argument)\n        // https://tc39.github.io/ecma262/#sec-isconstructor\n        function IsConstructor(argument) {\n            // NOTE: This is an approximation as we cannot check for [[Construct]] internal method.\n            return typeof argument === \"function\";\n        }\n        // 7.2.7 IsPropertyKey(argument)\n        // https://tc39.github.io/ecma262/#sec-ispropertykey\n        function IsPropertyKey(argument) {\n            switch (Type(argument)) {\n                case 3 /* String */: return true;\n                case 4 /* Symbol */: return true;\n                default: return false;\n            }\n        }\n        function SameValueZero(x, y) {\n            return x === y || x !== x && y !== y;\n        }\n        // 7.3 Operations on Objects\n        // https://tc39.github.io/ecma262/#sec-operations-on-objects\n        // 7.3.9 GetMethod(V, P)\n        // https://tc39.github.io/ecma262/#sec-getmethod\n        function GetMethod(V, P) {\n            var func = V[P];\n            if (func === undefined || func === null)\n                return undefined;\n            if (!IsCallable(func))\n                throw new TypeError();\n            return func;\n        }\n        // 7.4 Operations on Iterator Objects\n        // https://tc39.github.io/ecma262/#sec-operations-on-iterator-objects\n        function GetIterator(obj) {\n            var method = GetMethod(obj, iteratorSymbol);\n            if (!IsCallable(method))\n                throw new TypeError(); // from Call\n            var iterator = method.call(obj);\n            if (!IsObject(iterator))\n                throw new TypeError();\n            return iterator;\n        }\n        // 7.4.4 IteratorValue(iterResult)\n        // https://tc39.github.io/ecma262/2016/#sec-iteratorvalue\n        function IteratorValue(iterResult) {\n            return iterResult.value;\n        }\n        // 7.4.5 IteratorStep(iterator)\n        // https://tc39.github.io/ecma262/#sec-iteratorstep\n        function IteratorStep(iterator) {\n            var result = iterator.next();\n            return result.done ? false : result;\n        }\n        // 7.4.6 IteratorClose(iterator, completion)\n        // https://tc39.github.io/ecma262/#sec-iteratorclose\n        function IteratorClose(iterator) {\n            var f = iterator[\"return\"];\n            if (f)\n                f.call(iterator);\n        }\n        // 9.1 Ordinary Object Internal Methods and Internal Slots\n        // https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots\n        // 9.1.1.1 OrdinaryGetPrototypeOf(O)\n        // https://tc39.github.io/ecma262/#sec-ordinarygetprototypeof\n        function OrdinaryGetPrototypeOf(O) {\n            var proto = Object.getPrototypeOf(O);\n            if (typeof O !== \"function\" || O === functionPrototype)\n                return proto;\n            // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n            // Try to determine the superclass constructor. Compatible implementations\n            // must either set __proto__ on a subclass constructor to the superclass constructor,\n            // or ensure each class has a valid `constructor` property on its prototype that\n            // points back to the constructor.\n            // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n            // This is the case when in ES6 or when using __proto__ in a compatible browser.\n            if (proto !== functionPrototype)\n                return proto;\n            // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n            var prototype = O.prototype;\n            var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n            if (prototypeProto == null || prototypeProto === Object.prototype)\n                return proto;\n            // If the constructor was not a function, then we cannot determine the heritage.\n            var constructor = prototypeProto.constructor;\n            if (typeof constructor !== \"function\")\n                return proto;\n            // If we have some kind of self-reference, then we cannot determine the heritage.\n            if (constructor === O)\n                return proto;\n            // we have a pretty good guess at the heritage.\n            return constructor;\n        }\n        // Global metadata registry\n        // - Allows `import \"reflect-metadata\"` and `import \"reflect-metadata/no-conflict\"` to interoperate.\n        // - Uses isolated metadata if `Reflect` is frozen before the registry can be installed.\n        /**\n         * Creates a registry used to allow multiple `reflect-metadata` providers.\n         */\n        function CreateMetadataRegistry() {\n            var fallback;\n            if (!IsUndefined(registrySymbol) &&\n                typeof root.Reflect !== \"undefined\" &&\n                !(registrySymbol in root.Reflect) &&\n                typeof root.Reflect.defineMetadata === \"function\") {\n                // interoperate with older version of `reflect-metadata` that did not support a registry.\n                fallback = CreateFallbackProvider(root.Reflect);\n            }\n            var first;\n            var second;\n            var rest;\n            var targetProviderMap = new _WeakMap();\n            var registry = {\n                registerProvider: registerProvider,\n                getProvider: getProvider,\n                setProvider: setProvider,\n            };\n            return registry;\n            function registerProvider(provider) {\n                if (!Object.isExtensible(registry)) {\n                    throw new Error(\"Cannot add provider to a frozen registry.\");\n                }\n                switch (true) {\n                    case fallback === provider: break;\n                    case IsUndefined(first):\n                        first = provider;\n                        break;\n                    case first === provider: break;\n                    case IsUndefined(second):\n                        second = provider;\n                        break;\n                    case second === provider: break;\n                    default:\n                        if (rest === undefined)\n                            rest = new _Set();\n                        rest.add(provider);\n                        break;\n                }\n            }\n            function getProviderNoCache(O, P) {\n                if (!IsUndefined(first)) {\n                    if (first.isProviderFor(O, P))\n                        return first;\n                    if (!IsUndefined(second)) {\n                        if (second.isProviderFor(O, P))\n                            return first;\n                        if (!IsUndefined(rest)) {\n                            var iterator = GetIterator(rest);\n                            while (true) {\n                                var next = IteratorStep(iterator);\n                                if (!next) {\n                                    return undefined;\n                                }\n                                var provider = IteratorValue(next);\n                                if (provider.isProviderFor(O, P)) {\n                                    IteratorClose(iterator);\n                                    return provider;\n                                }\n                            }\n                        }\n                    }\n                }\n                if (!IsUndefined(fallback) && fallback.isProviderFor(O, P)) {\n                    return fallback;\n                }\n                return undefined;\n            }\n            function getProvider(O, P) {\n                var providerMap = targetProviderMap.get(O);\n                var provider;\n                if (!IsUndefined(providerMap)) {\n                    provider = providerMap.get(P);\n                }\n                if (!IsUndefined(provider)) {\n                    return provider;\n                }\n                provider = getProviderNoCache(O, P);\n                if (!IsUndefined(provider)) {\n                    if (IsUndefined(providerMap)) {\n                        providerMap = new _Map();\n                        targetProviderMap.set(O, providerMap);\n                    }\n                    providerMap.set(P, provider);\n                }\n                return provider;\n            }\n            function hasProvider(provider) {\n                if (IsUndefined(provider))\n                    throw new TypeError();\n                return first === provider || second === provider || !IsUndefined(rest) && rest.has(provider);\n            }\n            function setProvider(O, P, provider) {\n                if (!hasProvider(provider)) {\n                    throw new Error(\"Metadata provider not registered.\");\n                }\n                var existingProvider = getProvider(O, P);\n                if (existingProvider !== provider) {\n                    if (!IsUndefined(existingProvider)) {\n                        return false;\n                    }\n                    var providerMap = targetProviderMap.get(O);\n                    if (IsUndefined(providerMap)) {\n                        providerMap = new _Map();\n                        targetProviderMap.set(O, providerMap);\n                    }\n                    providerMap.set(P, provider);\n                }\n                return true;\n            }\n        }\n        /**\n         * Gets or creates the shared registry of metadata providers.\n         */\n        function GetOrCreateMetadataRegistry() {\n            var metadataRegistry;\n            if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {\n                metadataRegistry = root.Reflect[registrySymbol];\n            }\n            if (IsUndefined(metadataRegistry)) {\n                metadataRegistry = CreateMetadataRegistry();\n            }\n            if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {\n                Object.defineProperty(root.Reflect, registrySymbol, {\n                    enumerable: false,\n                    configurable: false,\n                    writable: false,\n                    value: metadataRegistry\n                });\n            }\n            return metadataRegistry;\n        }\n        function CreateMetadataProvider(registry) {\n            // [[Metadata]] internal slot\n            // https://rbuckton.github.io/reflect-metadata/#ordinary-object-internal-methods-and-internal-slots\n            var metadata = new _WeakMap();\n            var provider = {\n                isProviderFor: function (O, P) {\n                    var targetMetadata = metadata.get(O);\n                    if (IsUndefined(targetMetadata))\n                        return false;\n                    return targetMetadata.has(P);\n                },\n                OrdinaryDefineOwnMetadata: OrdinaryDefineOwnMetadata,\n                OrdinaryHasOwnMetadata: OrdinaryHasOwnMetadata,\n                OrdinaryGetOwnMetadata: OrdinaryGetOwnMetadata,\n                OrdinaryOwnMetadataKeys: OrdinaryOwnMetadataKeys,\n                OrdinaryDeleteMetadata: OrdinaryDeleteMetadata,\n            };\n            metadataRegistry.registerProvider(provider);\n            return provider;\n            function GetOrCreateMetadataMap(O, P, Create) {\n                var targetMetadata = metadata.get(O);\n                var createdTargetMetadata = false;\n                if (IsUndefined(targetMetadata)) {\n                    if (!Create)\n                        return undefined;\n                    targetMetadata = new _Map();\n                    metadata.set(O, targetMetadata);\n                    createdTargetMetadata = true;\n                }\n                var metadataMap = targetMetadata.get(P);\n                if (IsUndefined(metadataMap)) {\n                    if (!Create)\n                        return undefined;\n                    metadataMap = new _Map();\n                    targetMetadata.set(P, metadataMap);\n                    if (!registry.setProvider(O, P, provider)) {\n                        targetMetadata.delete(P);\n                        if (createdTargetMetadata) {\n                            metadata.delete(O);\n                        }\n                        throw new Error(\"Wrong provider for target.\");\n                    }\n                }\n                return metadataMap;\n            }\n            // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)\n            // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata\n            function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\n                var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n                if (IsUndefined(metadataMap))\n                    return false;\n                return ToBoolean(metadataMap.has(MetadataKey));\n            }\n            // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)\n            // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata\n            function OrdinaryGetOwnMetadata(MetadataKey, O, P) {\n                var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n                if (IsUndefined(metadataMap))\n                    return undefined;\n                return metadataMap.get(MetadataKey);\n            }\n            // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)\n            // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata\n            function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {\n                var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ true);\n                metadataMap.set(MetadataKey, MetadataValue);\n            }\n            // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)\n            // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys\n            function OrdinaryOwnMetadataKeys(O, P) {\n                var keys = [];\n                var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n                if (IsUndefined(metadataMap))\n                    return keys;\n                var keysObj = metadataMap.keys();\n                var iterator = GetIterator(keysObj);\n                var k = 0;\n                while (true) {\n                    var next = IteratorStep(iterator);\n                    if (!next) {\n                        keys.length = k;\n                        return keys;\n                    }\n                    var nextValue = IteratorValue(next);\n                    try {\n                        keys[k] = nextValue;\n                    }\n                    catch (e) {\n                        try {\n                            IteratorClose(iterator);\n                        }\n                        finally {\n                            throw e;\n                        }\n                    }\n                    k++;\n                }\n            }\n            function OrdinaryDeleteMetadata(MetadataKey, O, P) {\n                var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n                if (IsUndefined(metadataMap))\n                    return false;\n                if (!metadataMap.delete(MetadataKey))\n                    return false;\n                if (metadataMap.size === 0) {\n                    var targetMetadata = metadata.get(O);\n                    if (!IsUndefined(targetMetadata)) {\n                        targetMetadata.delete(P);\n                        if (targetMetadata.size === 0) {\n                            metadata.delete(targetMetadata);\n                        }\n                    }\n                }\n                return true;\n            }\n        }\n        function CreateFallbackProvider(reflect) {\n            var defineMetadata = reflect.defineMetadata, hasOwnMetadata = reflect.hasOwnMetadata, getOwnMetadata = reflect.getOwnMetadata, getOwnMetadataKeys = reflect.getOwnMetadataKeys, deleteMetadata = reflect.deleteMetadata;\n            var metadataOwner = new _WeakMap();\n            var provider = {\n                isProviderFor: function (O, P) {\n                    var metadataPropertySet = metadataOwner.get(O);\n                    if (!IsUndefined(metadataPropertySet) && metadataPropertySet.has(P)) {\n                        return true;\n                    }\n                    if (getOwnMetadataKeys(O, P).length) {\n                        if (IsUndefined(metadataPropertySet)) {\n                            metadataPropertySet = new _Set();\n                            metadataOwner.set(O, metadataPropertySet);\n                        }\n                        metadataPropertySet.add(P);\n                        return true;\n                    }\n                    return false;\n                },\n                OrdinaryDefineOwnMetadata: defineMetadata,\n                OrdinaryHasOwnMetadata: hasOwnMetadata,\n                OrdinaryGetOwnMetadata: getOwnMetadata,\n                OrdinaryOwnMetadataKeys: getOwnMetadataKeys,\n                OrdinaryDeleteMetadata: deleteMetadata,\n            };\n            return provider;\n        }\n        /**\n         * Gets the metadata provider for an object. If the object has no metadata provider and this is for a create operation,\n         * then this module's metadata provider is assigned to the object.\n         */\n        function GetMetadataProvider(O, P, Create) {\n            var registeredProvider = metadataRegistry.getProvider(O, P);\n            if (!IsUndefined(registeredProvider)) {\n                return registeredProvider;\n            }\n            if (Create) {\n                if (metadataRegistry.setProvider(O, P, metadataProvider)) {\n                    return metadataProvider;\n                }\n                throw new Error(\"Illegal state.\");\n            }\n            return undefined;\n        }\n        // naive Map shim\n        function CreateMapPolyfill() {\n            var cacheSentinel = {};\n            var arraySentinel = [];\n            var MapIterator = /** @class */ (function () {\n                function MapIterator(keys, values, selector) {\n                    this._index = 0;\n                    this._keys = keys;\n                    this._values = values;\n                    this._selector = selector;\n                }\n                MapIterator.prototype[\"@@iterator\"] = function () { return this; };\n                MapIterator.prototype[iteratorSymbol] = function () { return this; };\n                MapIterator.prototype.next = function () {\n                    var index = this._index;\n                    if (index >= 0 && index < this._keys.length) {\n                        var result = this._selector(this._keys[index], this._values[index]);\n                        if (index + 1 >= this._keys.length) {\n                            this._index = -1;\n                            this._keys = arraySentinel;\n                            this._values = arraySentinel;\n                        }\n                        else {\n                            this._index++;\n                        }\n                        return { value: result, done: false };\n                    }\n                    return { value: undefined, done: true };\n                };\n                MapIterator.prototype.throw = function (error) {\n                    if (this._index >= 0) {\n                        this._index = -1;\n                        this._keys = arraySentinel;\n                        this._values = arraySentinel;\n                    }\n                    throw error;\n                };\n                MapIterator.prototype.return = function (value) {\n                    if (this._index >= 0) {\n                        this._index = -1;\n                        this._keys = arraySentinel;\n                        this._values = arraySentinel;\n                    }\n                    return { value: value, done: true };\n                };\n                return MapIterator;\n            }());\n            var Map = /** @class */ (function () {\n                function Map() {\n                    this._keys = [];\n                    this._values = [];\n                    this._cacheKey = cacheSentinel;\n                    this._cacheIndex = -2;\n                }\n                Object.defineProperty(Map.prototype, \"size\", {\n                    get: function () { return this._keys.length; },\n                    enumerable: true,\n                    configurable: true\n                });\n                Map.prototype.has = function (key) { return this._find(key, /*insert*/ false) >= 0; };\n                Map.prototype.get = function (key) {\n                    var index = this._find(key, /*insert*/ false);\n                    return index >= 0 ? this._values[index] : undefined;\n                };\n                Map.prototype.set = function (key, value) {\n                    var index = this._find(key, /*insert*/ true);\n                    this._values[index] = value;\n                    return this;\n                };\n                Map.prototype.delete = function (key) {\n                    var index = this._find(key, /*insert*/ false);\n                    if (index >= 0) {\n                        var size = this._keys.length;\n                        for (var i = index + 1; i < size; i++) {\n                            this._keys[i - 1] = this._keys[i];\n                            this._values[i - 1] = this._values[i];\n                        }\n                        this._keys.length--;\n                        this._values.length--;\n                        if (SameValueZero(key, this._cacheKey)) {\n                            this._cacheKey = cacheSentinel;\n                            this._cacheIndex = -2;\n                        }\n                        return true;\n                    }\n                    return false;\n                };\n                Map.prototype.clear = function () {\n                    this._keys.length = 0;\n                    this._values.length = 0;\n                    this._cacheKey = cacheSentinel;\n                    this._cacheIndex = -2;\n                };\n                Map.prototype.keys = function () { return new MapIterator(this._keys, this._values, getKey); };\n                Map.prototype.values = function () { return new MapIterator(this._keys, this._values, getValue); };\n                Map.prototype.entries = function () { return new MapIterator(this._keys, this._values, getEntry); };\n                Map.prototype[\"@@iterator\"] = function () { return this.entries(); };\n                Map.prototype[iteratorSymbol] = function () { return this.entries(); };\n                Map.prototype._find = function (key, insert) {\n                    if (!SameValueZero(this._cacheKey, key)) {\n                        this._cacheIndex = -1;\n                        for (var i = 0; i < this._keys.length; i++) {\n                            if (SameValueZero(this._keys[i], key)) {\n                                this._cacheIndex = i;\n                                break;\n                            }\n                        }\n                    }\n                    if (this._cacheIndex < 0 && insert) {\n                        this._cacheIndex = this._keys.length;\n                        this._keys.push(key);\n                        this._values.push(undefined);\n                    }\n                    return this._cacheIndex;\n                };\n                return Map;\n            }());\n            return Map;\n            function getKey(key, _) {\n                return key;\n            }\n            function getValue(_, value) {\n                return value;\n            }\n            function getEntry(key, value) {\n                return [key, value];\n            }\n        }\n        // naive Set shim\n        function CreateSetPolyfill() {\n            var Set = /** @class */ (function () {\n                function Set() {\n                    this._map = new _Map();\n                }\n                Object.defineProperty(Set.prototype, \"size\", {\n                    get: function () { return this._map.size; },\n                    enumerable: true,\n                    configurable: true\n                });\n                Set.prototype.has = function (value) { return this._map.has(value); };\n                Set.prototype.add = function (value) { return this._map.set(value, value), this; };\n                Set.prototype.delete = function (value) { return this._map.delete(value); };\n                Set.prototype.clear = function () { this._map.clear(); };\n                Set.prototype.keys = function () { return this._map.keys(); };\n                Set.prototype.values = function () { return this._map.keys(); };\n                Set.prototype.entries = function () { return this._map.entries(); };\n                Set.prototype[\"@@iterator\"] = function () { return this.keys(); };\n                Set.prototype[iteratorSymbol] = function () { return this.keys(); };\n                return Set;\n            }());\n            return Set;\n        }\n        // naive WeakMap shim\n        function CreateWeakMapPolyfill() {\n            var UUID_SIZE = 16;\n            var keys = HashMap.create();\n            var rootKey = CreateUniqueKey();\n            return /** @class */ (function () {\n                function WeakMap() {\n                    this._key = CreateUniqueKey();\n                }\n                WeakMap.prototype.has = function (target) {\n                    var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n                    return table !== undefined ? HashMap.has(table, this._key) : false;\n                };\n                WeakMap.prototype.get = function (target) {\n                    var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n                    return table !== undefined ? HashMap.get(table, this._key) : undefined;\n                };\n                WeakMap.prototype.set = function (target, value) {\n                    var table = GetOrCreateWeakMapTable(target, /*create*/ true);\n                    table[this._key] = value;\n                    return this;\n                };\n                WeakMap.prototype.delete = function (target) {\n                    var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n                    return table !== undefined ? delete table[this._key] : false;\n                };\n                WeakMap.prototype.clear = function () {\n                    // NOTE: not a real clear, just makes the previous data unreachable\n                    this._key = CreateUniqueKey();\n                };\n                return WeakMap;\n            }());\n            function CreateUniqueKey() {\n                var key;\n                do\n                    key = \"@@WeakMap@@\" + CreateUUID();\n                while (HashMap.has(keys, key));\n                keys[key] = true;\n                return key;\n            }\n            function GetOrCreateWeakMapTable(target, create) {\n                if (!hasOwn.call(target, rootKey)) {\n                    if (!create)\n                        return undefined;\n                    Object.defineProperty(target, rootKey, { value: HashMap.create() });\n                }\n                return target[rootKey];\n            }\n            function FillRandomBytes(buffer, size) {\n                for (var i = 0; i < size; ++i)\n                    buffer[i] = Math.random() * 0xff | 0;\n                return buffer;\n            }\n            function GenRandomBytes(size) {\n                if (typeof Uint8Array === \"function\") {\n                    var array = new Uint8Array(size);\n                    if (typeof crypto !== \"undefined\") {\n                        crypto.getRandomValues(array);\n                    }\n                    else if (typeof msCrypto !== \"undefined\") {\n                        msCrypto.getRandomValues(array);\n                    }\n                    else {\n                        FillRandomBytes(array, size);\n                    }\n                    return array;\n                }\n                return FillRandomBytes(new Array(size), size);\n            }\n            function CreateUUID() {\n                var data = GenRandomBytes(UUID_SIZE);\n                // mark as random - RFC 4122 § 4.4\n                data[6] = data[6] & 0x4f | 0x40;\n                data[8] = data[8] & 0xbf | 0x80;\n                var result = \"\";\n                for (var offset = 0; offset < UUID_SIZE; ++offset) {\n                    var byte = data[offset];\n                    if (offset === 4 || offset === 6 || offset === 8)\n                        result += \"-\";\n                    if (byte < 16)\n                        result += \"0\";\n                    result += byte.toString(16).toLowerCase();\n                }\n                return result;\n            }\n        }\n        // uses a heuristic used by v8 and chakra to force an object into dictionary mode.\n        function MakeDictionary(obj) {\n            obj.__ = undefined;\n            delete obj.__;\n            return obj;\n        }\n    });\n})(Reflect || (Reflect = {}));\n\n}).call(this)}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],306:[function(require,module,exports){\n// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random();       // 0 <= x < 1.  Every bit is random.\n// var x = random.quick(); // 0 <= x < 1.  32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by François Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three.  It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures.  Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n\n},{\"./lib/alea\":307,\"./lib/tychei\":308,\"./lib/xor128\":309,\"./lib/xor4096\":310,\"./lib/xorshift7\":311,\"./lib/xorwow\":312,\"./seedrandom\":313}],307:[function(require,module,exports){\n// A port of an algorithm by Johannes Baagøe <baagoe@baagoe.com>, 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baagøe <baagoe@baagoe.org>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n  var me = this, mash = Mash();\n\n  me.next = function() {\n    var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n    me.s0 = me.s1;\n    me.s1 = me.s2;\n    return me.s2 = t - (me.c = t | 0);\n  };\n\n  // Apply the seeding algorithm from Baagoe.\n  me.c = 1;\n  me.s0 = mash(' ');\n  me.s1 = mash(' ');\n  me.s2 = mash(' ');\n  me.s0 -= mash(seed);\n  if (me.s0 < 0) { me.s0 += 1; }\n  me.s1 -= mash(seed);\n  if (me.s1 < 0) { me.s1 += 1; }\n  me.s2 -= mash(seed);\n  if (me.s2 < 0) { me.s2 += 1; }\n  mash = null;\n}\n\nfunction copy(f, t) {\n  t.c = f.c;\n  t.s0 = f.s0;\n  t.s1 = f.s1;\n  t.s2 = f.s2;\n  return t;\n}\n\nfunction impl(seed, opts) {\n  var xg = new Alea(seed),\n      state = opts && opts.state,\n      prng = xg.next;\n  prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n  prng.double = function() {\n    return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n  };\n  prng.quick = prng;\n  if (state) {\n    if (typeof(state) == 'object') copy(state, xg);\n    prng.state = function() { return copy(xg, {}); }\n  }\n  return prng;\n}\n\nfunction Mash() {\n  var n = 0xefc8249d;\n\n  var mash = function(data) {\n    data = String(data);\n    for (var i = 0; i < data.length; i++) {\n      n += data.charCodeAt(i);\n      var h = 0.02519603282416938 * n;\n      n = h >>> 0;\n      h -= n;\n      h *= n;\n      n = h >>> 0;\n      h -= n;\n      n += h * 0x100000000; // 2^32\n    }\n    return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n  };\n\n  return mash;\n}\n\n\nif (module && module.exports) {\n  module.exports = impl;\n} else if (define && define.amd) {\n  define(function() { return impl; });\n} else {\n  this.alea = impl;\n}\n\n})(\n  this,\n  (typeof module) == 'object' && module,    // present in node.js\n  (typeof define) == 'function' && define   // present with an AMD loader\n);\n\n\n\n},{}],308:[function(require,module,exports){\n// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n  var me = this, strseed = '';\n\n  // Set up generator function.\n  me.next = function() {\n    var b = me.b, c = me.c, d = me.d, a = me.a;\n    b = (b << 25) ^ (b >>> 7) ^ c;\n    c = (c - d) | 0;\n    d = (d << 24) ^ (d >>> 8) ^ a;\n    a = (a - b) | 0;\n    me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n    me.c = c = (c - d) | 0;\n    me.d = (d << 16) ^ (c >>> 16) ^ a;\n    return me.a = (a - b) | 0;\n  };\n\n  /* The following is non-inverted tyche, which has better internal\n   * bit diffusion, but which is about 25% slower than tyche-i in JS.\n  me.next = function() {\n    var a = me.a, b = me.b, c = me.c, d = me.d;\n    a = (me.a + me.b | 0) >>> 0;\n    d = me.d ^ a; d = d << 16 ^ d >>> 16;\n    c = me.c + d | 0;\n    b = me.b ^ c; b = b << 12 ^ d >>> 20;\n    me.a = a = a + b | 0;\n    d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n    me.c = c = c + d | 0;\n    b = b ^ c;\n    return me.b = (b << 7 ^ b >>> 25);\n  }\n  */\n\n  me.a = 0;\n  me.b = 0;\n  me.c = 2654435769 | 0;\n  me.d = 1367130551;\n\n  if (seed === Math.floor(seed)) {\n    // Integer seed.\n    me.a = (seed / 0x100000000) | 0;\n    me.b = seed | 0;\n  } else {\n    // String seed.\n    strseed += seed;\n  }\n\n  // Mix in string seed, then discard an initial batch of 64 values.\n  for (var k = 0; k < strseed.length + 20; k++) {\n    me.b ^= strseed.charCodeAt(k) | 0;\n    me.next();\n  }\n}\n\nfunction copy(f, t) {\n  t.a = f.a;\n  t.b = f.b;\n  t.c = f.c;\n  t.d = f.d;\n  return t;\n};\n\nfunction impl(seed, opts) {\n  var xg = new XorGen(seed),\n      state = opts && opts.state,\n      prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n  prng.double = function() {\n    do {\n      var top = xg.next() >>> 11,\n          bot = (xg.next() >>> 0) / 0x100000000,\n          result = (top + bot) / (1 << 21);\n    } while (result === 0);\n    return result;\n  };\n  prng.int32 = xg.next;\n  prng.quick = prng;\n  if (state) {\n    if (typeof(state) == 'object') copy(state, xg);\n    prng.state = function() { return copy(xg, {}); }\n  }\n  return prng;\n}\n\nif (module && module.exports) {\n  module.exports = impl;\n} else if (define && define.amd) {\n  define(function() { return impl; });\n} else {\n  this.tychei = impl;\n}\n\n})(\n  this,\n  (typeof module) == 'object' && module,    // present in node.js\n  (typeof define) == 'function' && define   // present with an AMD loader\n);\n\n\n\n},{}],309:[function(require,module,exports){\n// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia.  See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n  var me = this, strseed = '';\n\n  me.x = 0;\n  me.y = 0;\n  me.z = 0;\n  me.w = 0;\n\n  // Set up generator function.\n  me.next = function() {\n    var t = me.x ^ (me.x << 11);\n    me.x = me.y;\n    me.y = me.z;\n    me.z = me.w;\n    return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n  };\n\n  if (seed === (seed | 0)) {\n    // Integer seed.\n    me.x = seed;\n  } else {\n    // String seed.\n    strseed += seed;\n  }\n\n  // Mix in string seed, then discard an initial batch of 64 values.\n  for (var k = 0; k < strseed.length + 64; k++) {\n    me.x ^= strseed.charCodeAt(k) | 0;\n    me.next();\n  }\n}\n\nfunction copy(f, t) {\n  t.x = f.x;\n  t.y = f.y;\n  t.z = f.z;\n  t.w = f.w;\n  return t;\n}\n\nfunction impl(seed, opts) {\n  var xg = new XorGen(seed),\n      state = opts && opts.state,\n      prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n  prng.double = function() {\n    do {\n      var top = xg.next() >>> 11,\n          bot = (xg.next() >>> 0) / 0x100000000,\n          result = (top + bot) / (1 << 21);\n    } while (result === 0);\n    return result;\n  };\n  prng.int32 = xg.next;\n  prng.quick = prng;\n  if (state) {\n    if (typeof(state) == 'object') copy(state, xg);\n    prng.state = function() { return copy(xg, {}); }\n  }\n  return prng;\n}\n\nif (module && module.exports) {\n  module.exports = impl;\n} else if (define && define.amd) {\n  define(function() { return impl; });\n} else {\n  this.xor128 = impl;\n}\n\n})(\n  this,\n  (typeof module) == 'object' && module,    // present in node.js\n  (typeof define) == 'function' && define   // present with an AMD loader\n);\n\n\n\n},{}],310:[function(require,module,exports){\n// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated.  For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1);                        // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897);   // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C.  This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n  var me = this;\n\n  // Set up generator function.\n  me.next = function() {\n    var w = me.w,\n        X = me.X, i = me.i, t, v;\n    // Update Weyl generator.\n    me.w = w = (w + 0x61c88647) | 0;\n    // Update xor generator.\n    v = X[(i + 34) & 127];\n    t = X[i = ((i + 1) & 127)];\n    v ^= v << 13;\n    t ^= t << 17;\n    v ^= v >>> 15;\n    t ^= t >>> 12;\n    // Update Xor generator array state.\n    v = X[i] = v ^ t;\n    me.i = i;\n    // Result is the combination.\n    return (v + (w ^ (w >>> 16))) | 0;\n  };\n\n  function init(me, seed) {\n    var t, v, i, j, w, X = [], limit = 128;\n    if (seed === (seed | 0)) {\n      // Numeric seeds initialize v, which is used to generates X.\n      v = seed;\n      seed = null;\n    } else {\n      // String seeds are mixed into v and X one character at a time.\n      seed = seed + '\\0';\n      v = 0;\n      limit = Math.max(limit, seed.length);\n    }\n    // Initialize circular array and weyl value.\n    for (i = 0, j = -32; j < limit; ++j) {\n      // Put the unicode characters into the array, and shuffle them.\n      if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n      // After 32 shuffles, take v as the starting w value.\n      if (j === 0) w = v;\n      v ^= v << 10;\n      v ^= v >>> 15;\n      v ^= v << 4;\n      v ^= v >>> 13;\n      if (j >= 0) {\n        w = (w + 0x61c88647) | 0;     // Weyl.\n        t = (X[j & 127] ^= (v + w));  // Combine xor and weyl to init array.\n        i = (0 == t) ? i + 1 : 0;     // Count zeroes.\n      }\n    }\n    // We have detected all zeroes; make the key nonzero.\n    if (i >= 128) {\n      X[(seed && seed.length || 0) & 127] = -1;\n    }\n    // Run the generator 512 times to further mix the state before using it.\n    // Factoring this as a function slows the main generator, so it is just\n    // unrolled here.  The weyl generator is not advanced while warming up.\n    i = 127;\n    for (j = 4 * 128; j > 0; --j) {\n      v = X[(i + 34) & 127];\n      t = X[i = ((i + 1) & 127)];\n      v ^= v << 13;\n      t ^= t << 17;\n      v ^= v >>> 15;\n      t ^= t >>> 12;\n      X[i] = v ^ t;\n    }\n    // Storing state as object members is faster than using closure variables.\n    me.w = w;\n    me.X = X;\n    me.i = i;\n  }\n\n  init(me, seed);\n}\n\nfunction copy(f, t) {\n  t.i = f.i;\n  t.w = f.w;\n  t.X = f.X.slice();\n  return t;\n};\n\nfunction impl(seed, opts) {\n  if (seed == null) seed = +(new Date);\n  var xg = new XorGen(seed),\n      state = opts && opts.state,\n      prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n  prng.double = function() {\n    do {\n      var top = xg.next() >>> 11,\n          bot = (xg.next() >>> 0) / 0x100000000,\n          result = (top + bot) / (1 << 21);\n    } while (result === 0);\n    return result;\n  };\n  prng.int32 = xg.next;\n  prng.quick = prng;\n  if (state) {\n    if (state.X) copy(state, xg);\n    prng.state = function() { return copy(xg, {}); }\n  }\n  return prng;\n}\n\nif (module && module.exports) {\n  module.exports = impl;\n} else if (define && define.amd) {\n  define(function() { return impl; });\n} else {\n  this.xor4096 = impl;\n}\n\n})(\n  this,                                     // window object or global\n  (typeof module) == 'object' && module,    // present in node.js\n  (typeof define) == 'function' && define   // present with an AMD loader\n);\n\n},{}],311:[function(require,module,exports){\n// A Javascript implementaion of the \"xorshift7\" algorithm by\n// François Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n  var me = this;\n\n  // Set up generator function.\n  me.next = function() {\n    // Update xor generator.\n    var X = me.x, i = me.i, t, v, w;\n    t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n    t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n    t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n    t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n    t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n    X[i] = v;\n    me.i = (i + 1) & 7;\n    return v;\n  };\n\n  function init(me, seed) {\n    var j, w, X = [];\n\n    if (seed === (seed | 0)) {\n      // Seed state array using a 32-bit integer.\n      w = X[0] = seed;\n    } else {\n      // Seed state using a string.\n      seed = '' + seed;\n      for (j = 0; j < seed.length; ++j) {\n        X[j & 7] = (X[j & 7] << 15) ^\n            (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n      }\n    }\n    // Enforce an array length of 8, not all zeroes.\n    while (X.length < 8) X.push(0);\n    for (j = 0; j < 8 && X[j] === 0; ++j);\n    if (j == 8) w = X[7] = -1; else w = X[j];\n\n    me.x = X;\n    me.i = 0;\n\n    // Discard an initial 256 values.\n    for (j = 256; j > 0; --j) {\n      me.next();\n    }\n  }\n\n  init(me, seed);\n}\n\nfunction copy(f, t) {\n  t.x = f.x.slice();\n  t.i = f.i;\n  return t;\n}\n\nfunction impl(seed, opts) {\n  if (seed == null) seed = +(new Date);\n  var xg = new XorGen(seed),\n      state = opts && opts.state,\n      prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n  prng.double = function() {\n    do {\n      var top = xg.next() >>> 11,\n          bot = (xg.next() >>> 0) / 0x100000000,\n          result = (top + bot) / (1 << 21);\n    } while (result === 0);\n    return result;\n  };\n  prng.int32 = xg.next;\n  prng.quick = prng;\n  if (state) {\n    if (state.x) copy(state, xg);\n    prng.state = function() { return copy(xg, {}); }\n  }\n  return prng;\n}\n\nif (module && module.exports) {\n  module.exports = impl;\n} else if (define && define.amd) {\n  define(function() { return impl; });\n} else {\n  this.xorshift7 = impl;\n}\n\n})(\n  this,\n  (typeof module) == 'object' && module,    // present in node.js\n  (typeof define) == 'function' && define   // present with an AMD loader\n);\n\n\n},{}],312:[function(require,module,exports){\n// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia.  See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n  var me = this, strseed = '';\n\n  // Set up generator function.\n  me.next = function() {\n    var t = (me.x ^ (me.x >>> 2));\n    me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n    return (me.d = (me.d + 362437 | 0)) +\n       (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n  };\n\n  me.x = 0;\n  me.y = 0;\n  me.z = 0;\n  me.w = 0;\n  me.v = 0;\n\n  if (seed === (seed | 0)) {\n    // Integer seed.\n    me.x = seed;\n  } else {\n    // String seed.\n    strseed += seed;\n  }\n\n  // Mix in string seed, then discard an initial batch of 64 values.\n  for (var k = 0; k < strseed.length + 64; k++) {\n    me.x ^= strseed.charCodeAt(k) | 0;\n    if (k == strseed.length) {\n      me.d = me.x << 10 ^ me.x >>> 4;\n    }\n    me.next();\n  }\n}\n\nfunction copy(f, t) {\n  t.x = f.x;\n  t.y = f.y;\n  t.z = f.z;\n  t.w = f.w;\n  t.v = f.v;\n  t.d = f.d;\n  return t;\n}\n\nfunction impl(seed, opts) {\n  var xg = new XorGen(seed),\n      state = opts && opts.state,\n      prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n  prng.double = function() {\n    do {\n      var top = xg.next() >>> 11,\n          bot = (xg.next() >>> 0) / 0x100000000,\n          result = (top + bot) / (1 << 21);\n    } while (result === 0);\n    return result;\n  };\n  prng.int32 = xg.next;\n  prng.quick = prng;\n  if (state) {\n    if (typeof(state) == 'object') copy(state, xg);\n    prng.state = function() { return copy(xg, {}); }\n  }\n  return prng;\n}\n\nif (module && module.exports) {\n  module.exports = impl;\n} else if (define && define.amd) {\n  define(function() { return impl; });\n} else {\n  this.xorwow = impl;\n}\n\n})(\n  this,\n  (typeof module) == 'object' && module,    // present in node.js\n  (typeof define) == 'function' && define   // present with an AMD loader\n);\n\n\n\n},{}],313:[function(require,module,exports){\n/*\nCopyright 2019 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (global, pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\n\nvar width = 256,        // each RC4 output is 0 <= x < 256\n    chunks = 6,         // at least six RC4 outputs for each double\n    digits = 52,        // there are 52 significant digits in a double\n    rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n    startdenom = math.pow(width, chunks),\n    significance = math.pow(2, digits),\n    overflow = significance * 2,\n    mask = width - 1,\n    nodecrypto;         // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n  var key = [];\n  options = (options == true) ? { entropy: true } : (options || {});\n\n  // Flatten the seed string or build one from local entropy if needed.\n  var shortseed = mixkey(flatten(\n    options.entropy ? [seed, tostring(pool)] :\n    (seed == null) ? autoseed() : seed, 3), key);\n\n  // Use the seed to initialize an ARC4 generator.\n  var arc4 = new ARC4(key);\n\n  // This function returns a random double in [0, 1) that contains\n  // randomness in every bit of the mantissa of the IEEE 754 value.\n  var prng = function() {\n    var n = arc4.g(chunks),             // Start with a numerator n < 2 ^ 48\n        d = startdenom,                 //   and denominator d = 2 ^ 48.\n        x = 0;                          //   and no 'extra last byte'.\n    while (n < significance) {          // Fill up all significant digits by\n      n = (n + x) * width;              //   shifting numerator and\n      d *= width;                       //   denominator and generating a\n      x = arc4.g(1);                    //   new least-significant-byte.\n    }\n    while (n >= overflow) {             // To avoid rounding up, before adding\n      n /= 2;                           //   last byte, shift everything\n      d /= 2;                           //   right using integer math until\n      x >>>= 1;                         //   we have exactly the desired bits.\n    }\n    return (n + x) / d;                 // Form the number within [0, 1).\n  };\n\n  prng.int32 = function() { return arc4.g(4) | 0; }\n  prng.quick = function() { return arc4.g(4) / 0x100000000; }\n  prng.double = prng;\n\n  // Mix the randomness into accumulated entropy.\n  mixkey(tostring(arc4.S), pool);\n\n  // Calling convention: what to return as a function of prng, seed, is_math.\n  return (options.pass || callback ||\n      function(prng, seed, is_math_call, state) {\n        if (state) {\n          // Load the arc4 state from the given state if it has an S array.\n          if (state.S) { copy(state, arc4); }\n          // Only provide the .state method if requested via options.state.\n          prng.state = function() { return copy(arc4, {}); }\n        }\n\n        // If called as a method of Math (Math.seedrandom()), mutate\n        // Math.random because that is how seedrandom.js has worked since v1.0.\n        if (is_math_call) { math[rngname] = prng; return seed; }\n\n        // Otherwise, it is a newer calling convention, so return the\n        // prng directly.\n        else return prng;\n      })(\n  prng,\n  shortseed,\n  'global' in options ? options.global : (this == math),\n  options.state);\n}\n\n//\n// ARC4\n//\n// An ARC4 implementation.  The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4.  Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n  var t, keylen = key.length,\n      me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n  // The empty key [] is treated as [0].\n  if (!keylen) { key = [keylen++]; }\n\n  // Set up S using the standard key scheduling algorithm.\n  while (i < width) {\n    s[i] = i++;\n  }\n  for (i = 0; i < width; i++) {\n    s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n    s[j] = t;\n  }\n\n  // The \"g\" method returns the next (count) outputs as one number.\n  (me.g = function(count) {\n    // Using instance members instead of closure state nearly doubles speed.\n    var t, r = 0,\n        i = me.i, j = me.j, s = me.S;\n    while (count--) {\n      t = s[i = mask & (i + 1)];\n      r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n    }\n    me.i = i; me.j = j;\n    return r;\n    // For robust unpredictability, the function call below automatically\n    // discards an initial batch of values.  This is called RC4-drop[256].\n    // See http://google.com/search?q=rsa+fluhrer+response&btnI\n  })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n  t.i = f.i;\n  t.j = f.j;\n  t.S = f.S.slice();\n  return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n  var result = [], typ = (typeof obj), prop;\n  if (depth && typ == 'object') {\n    for (prop in obj) {\n      try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n    }\n  }\n  return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n  var stringseed = seed + '', smear, j = 0;\n  while (j < stringseed.length) {\n    key[mask & j] =\n      mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n  }\n  return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n  try {\n    var out;\n    if (nodecrypto && (out = nodecrypto.randomBytes)) {\n      // The use of 'out' to remember randomBytes makes tight minified code.\n      out = out(width);\n    } else {\n      out = new Uint8Array(width);\n      (global.crypto || global.msCrypto).getRandomValues(out);\n    }\n    return tostring(out);\n  } catch (e) {\n    var browser = global.navigator,\n        plugins = browser && browser.plugins;\n    return [+new Date, global, plugins, global.screen, tostring(pool)];\n  }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n  return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool.  Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n  module.exports = seedrandom;\n  // When in node.js, try using crypto package for autoseeding.\n  try {\n    nodecrypto = require('crypto');\n  } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n  define(function() { return seedrandom; });\n} else {\n  // When included as a plain script, set up Math.seedrandom global.\n  math['seed' + rngname] = seedrandom;\n}\n\n\n// End anonymous scope, and pass initial values.\n})(\n  // global: `self` in browsers (including strict mode and web workers),\n  // otherwise `this` in Node and other environments\n  (typeof self !== 'undefined') ? self : this,\n  [],     // pool: entropy pool starts empty\n  Math    // math: package containing random, pow, and seedrandom\n);\n\n},{\"crypto\":249}],314:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Mixin = Mixin;\nexports.settings = exports.mix = exports.hasMixin = exports.decorate = void 0;\nfunction _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\n/**\n * Utility function that works like `Object.apply`, but copies getters and setters properly as well.  Additionally gives\n * the option to exclude properties by name.\n */\nvar copyProps = function copyProps(dest, src) {\n  var exclude = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n  var props = Object.getOwnPropertyDescriptors(src);\n  var _iterator = _createForOfIteratorHelper(exclude),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var prop = _step.value;\n      delete props[prop];\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  Object.defineProperties(dest, props);\n};\n/**\n * Returns the full chain of prototypes up until Object.prototype given a starting object.  The order of prototypes will\n * be closest to farthest in the chain.\n */\nvar _protoChain = function protoChain(obj) {\n  var currentChain = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [obj];\n  var proto = Object.getPrototypeOf(obj);\n  if (proto === null) return currentChain;\n  return _protoChain(proto, [].concat(_toConsumableArray(currentChain), [proto]));\n};\n/**\n * Identifies the nearest ancestor common to all the given objects in their prototype chains.  For most unrelated\n * objects, this function should return Object.prototype.\n */\nvar nearestCommonProto = function nearestCommonProto() {\n  for (var _len = arguments.length, objs = new Array(_len), _key = 0; _key < _len; _key++) {\n    objs[_key] = arguments[_key];\n  }\n  if (objs.length === 0) return undefined;\n  var commonProto = undefined;\n  var protoChains = objs.map(function (obj) {\n    return _protoChain(obj);\n  });\n  var _loop = function _loop() {\n    var protos = protoChains.map(function (protoChain) {\n      return protoChain.pop();\n    });\n    var potentialCommonProto = protos[0];\n    if (protos.every(function (proto) {\n      return proto === potentialCommonProto;\n    })) commonProto = potentialCommonProto;else return 1; // break\n  };\n  while (protoChains.every(function (protoChain) {\n    return protoChain.length > 0;\n  })) {\n    if (_loop()) break;\n  }\n  return commonProto;\n};\n/**\n * Creates a new prototype object that is a mixture of the given prototypes.  The mixing is achieved by first\n * identifying the nearest common ancestor and using it as the prototype for a new object.  Then all properties/methods\n * downstream of this prototype (ONLY downstream) are copied into the new object.\n *\n * The resulting prototype is more performant than softMixProtos(...), as well as ES5 compatible.  However, it's not as\n * flexible as updates to the source prototypes aren't captured by the mixed result.  See softMixProtos for why you may\n * want to use that instead.\n */\nvar hardMixProtos = function hardMixProtos(ingredients, constructor) {\n  var exclude = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n  var _a;\n  var base = (_a = nearestCommonProto.apply(void 0, _toConsumableArray(ingredients))) !== null && _a !== void 0 ? _a : Object.prototype;\n  var mixedProto = Object.create(base);\n  // Keeps track of prototypes we've already visited to avoid copying the same properties multiple times.  We init the\n  // list with the proto chain below the nearest common ancestor because we don't want any of those methods mixed in\n  // when they will already be accessible via prototype access.\n  var visitedProtos = _protoChain(base);\n  var _iterator2 = _createForOfIteratorHelper(ingredients),\n    _step2;\n  try {\n    for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n      var prototype = _step2.value;\n      var protos = _protoChain(prototype);\n      // Apply the prototype chain in reverse order so that old methods don't override newer ones.\n      for (var i = protos.length - 1; i >= 0; i--) {\n        var newProto = protos[i];\n        if (visitedProtos.indexOf(newProto) === -1) {\n          copyProps(mixedProto, newProto, ['constructor'].concat(_toConsumableArray(exclude)));\n          visitedProtos.push(newProto);\n        }\n      }\n    }\n  } catch (err) {\n    _iterator2.e(err);\n  } finally {\n    _iterator2.f();\n  }\n  mixedProto.constructor = constructor;\n  return mixedProto;\n};\nvar unique = function unique(arr) {\n  return arr.filter(function (e, i) {\n    return arr.indexOf(e) == i;\n  });\n};\n\n/**\n * Finds the ingredient with the given prop, searching in reverse order and breadth-first if searching ingredient\n * prototypes is required.\n */\nvar getIngredientWithProp = function getIngredientWithProp(prop, ingredients) {\n  var protoChains = ingredients.map(function (ingredient) {\n    return _protoChain(ingredient);\n  });\n  // since we search breadth-first, we need to keep track of our depth in the prototype chains\n  var protoDepth = 0;\n  // not all prototype chains are the same depth, so this remains true as long as at least one of the ingredients'\n  // prototype chains has an object at this depth\n  var protosAreLeftToSearch = true;\n  while (protosAreLeftToSearch) {\n    // with the start of each horizontal slice, we assume this is the one that's deeper than any of the proto chains\n    protosAreLeftToSearch = false;\n    // scan through the ingredients right to left\n    for (var i = ingredients.length - 1; i >= 0; i--) {\n      var searchTarget = protoChains[i][protoDepth];\n      if (searchTarget !== undefined && searchTarget !== null) {\n        // if we find something, this is proof that this horizontal slice potentially more objects to search\n        protosAreLeftToSearch = true;\n        // eureka, we found it\n        if (Object.getOwnPropertyDescriptor(searchTarget, prop) != undefined) {\n          return protoChains[i][0];\n        }\n      }\n    }\n    protoDepth++;\n  }\n  return undefined;\n};\n/**\n * \"Mixes\" ingredients by wrapping them in a Proxy.  The optional prototype argument allows the mixed object to sit\n * downstream of an existing prototype chain.  Note that \"properties\" cannot be added, deleted, or modified.\n */\nvar proxyMix = function proxyMix(ingredients) {\n  var prototype = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Object.prototype;\n  return new Proxy({}, {\n    getPrototypeOf: function getPrototypeOf() {\n      return prototype;\n    },\n    setPrototypeOf: function setPrototypeOf() {\n      throw Error('Cannot set prototype of Proxies created by ts-mixer');\n    },\n    getOwnPropertyDescriptor: function getOwnPropertyDescriptor(_, prop) {\n      return Object.getOwnPropertyDescriptor(getIngredientWithProp(prop, ingredients) || {}, prop);\n    },\n    defineProperty: function defineProperty() {\n      throw new Error('Cannot define new properties on Proxies created by ts-mixer');\n    },\n    has: function has(_, prop) {\n      return getIngredientWithProp(prop, ingredients) !== undefined || prototype[prop] !== undefined;\n    },\n    get: function get(_, prop) {\n      return (getIngredientWithProp(prop, ingredients) || prototype)[prop];\n    },\n    set: function set(_, prop, val) {\n      var ingredientWithProp = getIngredientWithProp(prop, ingredients);\n      if (ingredientWithProp === undefined) throw new Error('Cannot set new properties on Proxies created by ts-mixer');\n      ingredientWithProp[prop] = val;\n      return true;\n    },\n    deleteProperty: function deleteProperty() {\n      throw new Error('Cannot delete properties on Proxies created by ts-mixer');\n    },\n    ownKeys: function ownKeys() {\n      return ingredients.map(Object.getOwnPropertyNames).reduce(function (prev, curr) {\n        return curr.concat(prev.filter(function (key) {\n          return curr.indexOf(key) < 0;\n        }));\n      });\n    }\n  });\n};\n/**\n * Creates a new proxy-prototype object that is a \"soft\" mixture of the given prototypes.  The mixing is achieved by\n * proxying all property access to the ingredients.  This is not ES5 compatible and less performant.  However, any\n * changes made to the source prototypes will be reflected in the proxy-prototype, which may be desirable.\n */\nvar softMixProtos = function softMixProtos(ingredients, constructor) {\n  return proxyMix([].concat(_toConsumableArray(ingredients), [{\n    constructor: constructor\n  }]));\n};\nvar settings = exports.settings = {\n  initFunction: null,\n  staticsStrategy: 'copy',\n  prototypeStrategy: 'copy',\n  decoratorInheritance: 'deep'\n};\n\n// Keeps track of constituent classes for every mixin class created by ts-mixer.\nvar mixins = new WeakMap();\nvar getMixinsForClass = function getMixinsForClass(clazz) {\n  return mixins.get(clazz);\n};\nvar registerMixins = function registerMixins(mixedClass, constituents) {\n  return mixins.set(mixedClass, constituents);\n};\nvar hasMixin = exports.hasMixin = function hasMixin(instance, mixin) {\n  if (instance instanceof mixin) return true;\n  var constructor = instance.constructor;\n  var visited = new Set();\n  var frontier = new Set();\n  frontier.add(constructor);\n  var _loop2 = function _loop2() {\n      // check if the frontier has the mixin we're looking for.  if not, we can say we visited every item in the frontier\n      if (frontier.has(mixin)) return {\n        v: true\n      };\n      frontier.forEach(function (item) {\n        return visited.add(item);\n      });\n      // build a new frontier based on the associated mixin classes and prototype chains of each frontier item\n      var newFrontier = new Set();\n      frontier.forEach(function (item) {\n        var _a;\n        var itemConstituents = (_a = mixins.get(item)) !== null && _a !== void 0 ? _a : _protoChain(item.prototype).map(function (proto) {\n          return proto.constructor;\n        }).filter(function (item) {\n          return item !== null;\n        });\n        if (itemConstituents) itemConstituents.forEach(function (constituent) {\n          if (!visited.has(constituent) && !frontier.has(constituent)) newFrontier.add(constituent);\n        });\n      });\n      // we have a new frontier, now search again\n      frontier = newFrontier;\n    },\n    _ret;\n  while (frontier.size > 0) {\n    _ret = _loop2();\n    if (_ret) return _ret.v;\n  }\n  // if we get here, we couldn't find the mixin anywhere in the prototype chain or associated mixin classes\n  return false;\n};\nvar mergeObjectsOfDecorators = function mergeObjectsOfDecorators(o1, o2) {\n  var _a, _b;\n  var allKeys = unique([].concat(_toConsumableArray(Object.getOwnPropertyNames(o1)), _toConsumableArray(Object.getOwnPropertyNames(o2))));\n  var mergedObject = {};\n  var _iterator3 = _createForOfIteratorHelper(allKeys),\n    _step3;\n  try {\n    for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n      var key = _step3.value;\n      mergedObject[key] = unique([].concat(_toConsumableArray((_a = o1 === null || o1 === void 0 ? void 0 : o1[key]) !== null && _a !== void 0 ? _a : []), _toConsumableArray((_b = o2 === null || o2 === void 0 ? void 0 : o2[key]) !== null && _b !== void 0 ? _b : [])));\n    }\n  } catch (err) {\n    _iterator3.e(err);\n  } finally {\n    _iterator3.f();\n  }\n  return mergedObject;\n};\nvar mergePropertyAndMethodDecorators = function mergePropertyAndMethodDecorators(d1, d2) {\n  var _a, _b, _c, _d;\n  return {\n    property: mergeObjectsOfDecorators((_a = d1 === null || d1 === void 0 ? void 0 : d1.property) !== null && _a !== void 0 ? _a : {}, (_b = d2 === null || d2 === void 0 ? void 0 : d2.property) !== null && _b !== void 0 ? _b : {}),\n    method: mergeObjectsOfDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1.method) !== null && _c !== void 0 ? _c : {}, (_d = d2 === null || d2 === void 0 ? void 0 : d2.method) !== null && _d !== void 0 ? _d : {})\n  };\n};\nvar mergeDecorators = function mergeDecorators(d1, d2) {\n  var _a, _b, _c, _d, _e, _f;\n  return {\n    \"class\": unique([].concat(_toConsumableArray((_a = d1 === null || d1 === void 0 ? void 0 : d1[\"class\"]) !== null && _a !== void 0 ? _a : []), _toConsumableArray((_b = d2 === null || d2 === void 0 ? void 0 : d2[\"class\"]) !== null && _b !== void 0 ? _b : []))),\n    \"static\": mergePropertyAndMethodDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1[\"static\"]) !== null && _c !== void 0 ? _c : {}, (_d = d2 === null || d2 === void 0 ? void 0 : d2[\"static\"]) !== null && _d !== void 0 ? _d : {}),\n    instance: mergePropertyAndMethodDecorators((_e = d1 === null || d1 === void 0 ? void 0 : d1.instance) !== null && _e !== void 0 ? _e : {}, (_f = d2 === null || d2 === void 0 ? void 0 : d2.instance) !== null && _f !== void 0 ? _f : {})\n  };\n};\nvar decorators = new Map();\nvar findAllConstituentClasses = function findAllConstituentClasses() {\n  var _a;\n  var allClasses = new Set();\n  for (var _len2 = arguments.length, classes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n    classes[_key2] = arguments[_key2];\n  }\n  var frontier = new Set([].concat(classes));\n  while (frontier.size > 0) {\n    var _iterator4 = _createForOfIteratorHelper(frontier),\n      _step4;\n    try {\n      for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n        var clazz = _step4.value;\n        var protoChainClasses = _protoChain(clazz.prototype).map(function (proto) {\n          return proto.constructor;\n        });\n        var mixinClasses = (_a = getMixinsForClass(clazz)) !== null && _a !== void 0 ? _a : [];\n        var potentiallyNewClasses = [].concat(_toConsumableArray(protoChainClasses), _toConsumableArray(mixinClasses));\n        var newClasses = potentiallyNewClasses.filter(function (c) {\n          return !allClasses.has(c);\n        });\n        var _iterator5 = _createForOfIteratorHelper(newClasses),\n          _step5;\n        try {\n          for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n            var newClass = _step5.value;\n            frontier.add(newClass);\n          }\n        } catch (err) {\n          _iterator5.e(err);\n        } finally {\n          _iterator5.f();\n        }\n        allClasses.add(clazz);\n        frontier[\"delete\"](clazz);\n      }\n    } catch (err) {\n      _iterator4.e(err);\n    } finally {\n      _iterator4.f();\n    }\n  }\n  return _toConsumableArray(allClasses);\n};\nvar deepDecoratorSearch = function deepDecoratorSearch() {\n  var decoratorsForClassChain = findAllConstituentClasses.apply(void 0, arguments).map(function (clazz) {\n    return decorators.get(clazz);\n  }).filter(function (decorators) {\n    return !!decorators;\n  });\n  if (decoratorsForClassChain.length == 0) return {};\n  if (decoratorsForClassChain.length == 1) return decoratorsForClassChain[0];\n  return decoratorsForClassChain.reduce(function (d1, d2) {\n    return mergeDecorators(d1, d2);\n  });\n};\nvar directDecoratorSearch = function directDecoratorSearch() {\n  for (var _len3 = arguments.length, classes = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n    classes[_key3] = arguments[_key3];\n  }\n  var classDecorators = classes.map(function (clazz) {\n    return getDecoratorsForClass(clazz);\n  });\n  if (classDecorators.length === 0) return {};\n  if (classDecorators.length === 1) return classDecorators[0];\n  return classDecorators.reduce(function (d1, d2) {\n    return mergeDecorators(d1, d2);\n  });\n};\nvar getDecoratorsForClass = function getDecoratorsForClass(clazz) {\n  var decoratorsForClass = decorators.get(clazz);\n  if (!decoratorsForClass) {\n    decoratorsForClass = {};\n    decorators.set(clazz, decoratorsForClass);\n  }\n  return decoratorsForClass;\n};\nvar decorateClass = function decorateClass(decorator) {\n  return function (clazz) {\n    var decoratorsForClass = getDecoratorsForClass(clazz);\n    var classDecorators = decoratorsForClass[\"class\"];\n    if (!classDecorators) {\n      classDecorators = [];\n      decoratorsForClass[\"class\"] = classDecorators;\n    }\n    classDecorators.push(decorator);\n    return decorator(clazz);\n  };\n};\nvar decorateMember = function decorateMember(decorator) {\n  return function (object, key) {\n    var _a, _b, _c;\n    var decoratorTargetType = typeof object === 'function' ? 'static' : 'instance';\n    var decoratorType = typeof object[key] === 'function' ? 'method' : 'property';\n    var clazz = decoratorTargetType === 'static' ? object : object.constructor;\n    var decoratorsForClass = getDecoratorsForClass(clazz);\n    var decoratorsForTargetType = (_a = decoratorsForClass === null || decoratorsForClass === void 0 ? void 0 : decoratorsForClass[decoratorTargetType]) !== null && _a !== void 0 ? _a : {};\n    decoratorsForClass[decoratorTargetType] = decoratorsForTargetType;\n    var decoratorsForType = (_b = decoratorsForTargetType === null || decoratorsForTargetType === void 0 ? void 0 : decoratorsForTargetType[decoratorType]) !== null && _b !== void 0 ? _b : {};\n    decoratorsForTargetType[decoratorType] = decoratorsForType;\n    var decoratorsForKey = (_c = decoratorsForType === null || decoratorsForType === void 0 ? void 0 : decoratorsForType[key]) !== null && _c !== void 0 ? _c : [];\n    decoratorsForType[key] = decoratorsForKey;\n    // @ts-ignore: array is type `A[] | B[]` and item is type `A | B`, so technically a type error, but it's fine\n    decoratorsForKey.push(decorator);\n    // @ts-ignore\n    for (var _len4 = arguments.length, otherArgs = new Array(_len4 > 2 ? _len4 - 2 : 0), _key4 = 2; _key4 < _len4; _key4++) {\n      otherArgs[_key4 - 2] = arguments[_key4];\n    }\n    return decorator.apply(void 0, [object, key].concat(otherArgs));\n  };\n};\nvar decorate = exports.decorate = function decorate(decorator) {\n  return function () {\n    if (arguments.length === 1) return decorateClass(decorator)(arguments.length <= 0 ? undefined : arguments[0]);\n    return decorateMember(decorator).apply(void 0, arguments);\n  };\n};\nfunction Mixin() {\n  for (var _len5 = arguments.length, constructors = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n    constructors[_key5] = arguments[_key5];\n  }\n  var _a, _b, _c;\n  var prototypes = constructors.map(function (constructor) {\n    return constructor.prototype;\n  });\n  // Here we gather up the init functions of the ingredient prototypes, combine them into one init function, and\n  // attach it to the mixed class prototype.  The reason we do this is because we want the init functions to mix\n  // similarly to constructors -- not methods, which simply override each other.\n  var initFunctionName = settings.initFunction;\n  if (initFunctionName !== null) {\n    var initFunctions = prototypes.map(function (proto) {\n      return proto[initFunctionName];\n    }).filter(function (func) {\n      return typeof func === 'function';\n    });\n    var combinedInitFunction = function combinedInitFunction() {\n      for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n        args[_key6] = arguments[_key6];\n      }\n      var _iterator6 = _createForOfIteratorHelper(initFunctions),\n        _step6;\n      try {\n        for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n          var initFunction = _step6.value;\n          initFunction.apply(this, args);\n        }\n      } catch (err) {\n        _iterator6.e(err);\n      } finally {\n        _iterator6.f();\n      }\n    };\n    var extraProto = _defineProperty({}, initFunctionName, combinedInitFunction);\n    prototypes.push(extraProto);\n  }\n  function MixedClass() {\n    for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n      args[_key7] = arguments[_key7];\n    }\n    var _iterator7 = _createForOfIteratorHelper(constructors),\n      _step7;\n    try {\n      for (_iterator7.s(); !(_step7 = _iterator7.n()).done;)\n      // @ts-ignore: potentially abstract class\n      {\n        var _constructor = _step7.value;\n        copyProps(this, _construct(_constructor, args));\n      }\n    } catch (err) {\n      _iterator7.e(err);\n    } finally {\n      _iterator7.f();\n    }\n    if (initFunctionName !== null && typeof this[initFunctionName] === 'function') this[initFunctionName].apply(this, args);\n  }\n  MixedClass.prototype = settings.prototypeStrategy === 'copy' ? hardMixProtos(prototypes, MixedClass) : softMixProtos(prototypes, MixedClass);\n  Object.setPrototypeOf(MixedClass, settings.staticsStrategy === 'copy' ? hardMixProtos(constructors, null, ['prototype']) : proxyMix(constructors, Function.prototype));\n  var DecoratedMixedClass = MixedClass;\n  if (settings.decoratorInheritance !== 'none') {\n    var classDecorators = settings.decoratorInheritance === 'deep' ? deepDecoratorSearch.apply(void 0, constructors) : directDecoratorSearch.apply(void 0, constructors);\n    var _iterator8 = _createForOfIteratorHelper((_a = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators[\"class\"]) !== null && _a !== void 0 ? _a : []),\n      _step8;\n    try {\n      for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {\n        var decorator = _step8.value;\n        var result = decorator(DecoratedMixedClass);\n        if (result) {\n          DecoratedMixedClass = result;\n        }\n      }\n    } catch (err) {\n      _iterator8.e(err);\n    } finally {\n      _iterator8.f();\n    }\n    applyPropAndMethodDecorators((_b = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators[\"static\"]) !== null && _b !== void 0 ? _b : {}, DecoratedMixedClass);\n    applyPropAndMethodDecorators((_c = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.instance) !== null && _c !== void 0 ? _c : {}, DecoratedMixedClass.prototype);\n  }\n  registerMixins(DecoratedMixedClass, constructors);\n  return DecoratedMixedClass;\n}\nvar applyPropAndMethodDecorators = function applyPropAndMethodDecorators(propAndMethodDecorators, target) {\n  var propDecorators = propAndMethodDecorators.property;\n  var methodDecorators = propAndMethodDecorators.method;\n  if (propDecorators) for (var key in propDecorators) {\n    var _iterator9 = _createForOfIteratorHelper(propDecorators[key]),\n      _step9;\n    try {\n      for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {\n        var decorator = _step9.value;\n        decorator(target, key);\n      }\n    } catch (err) {\n      _iterator9.e(err);\n    } finally {\n      _iterator9.f();\n    }\n  }\n  if (methodDecorators) for (var _key8 in methodDecorators) {\n    var _iterator10 = _createForOfIteratorHelper(methodDecorators[_key8]),\n      _step10;\n    try {\n      for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {\n        var _decorator = _step10.value;\n        _decorator(target, _key8, Object.getOwnPropertyDescriptor(target, _key8));\n      }\n    } catch (err) {\n      _iterator10.e(err);\n    } finally {\n      _iterator10.f();\n    }\n  }\n};\n/**\n * A decorator version of the `Mixin` function.  You'll want to use this instead of `Mixin` for mixing generic classes.\n */\nvar mix = exports.mix = function mix() {\n  for (var _len8 = arguments.length, ingredients = new Array(_len8), _key9 = 0; _key9 < _len8; _key9++) {\n    ingredients[_key9] = arguments[_key9];\n  }\n  return function (decoratedClass) {\n    // @ts-ignore\n    var mixedClass = Mixin.apply(void 0, _toConsumableArray(ingredients.concat([decoratedClass])));\n    Object.defineProperty(mixedClass, 'name', {\n      value: decoratedClass.name,\n      writable: false\n    });\n    return mixedClass;\n  };\n};\n\n},{}],315:[function(require,module,exports){\n(function (global){(function (){\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global global, define, Symbol, Reflect, Promise, SuppressedError, Iterator */\r\nvar __extends;\r\nvar __assign;\r\nvar __rest;\r\nvar __decorate;\r\nvar __param;\r\nvar __esDecorate;\r\nvar __runInitializers;\r\nvar __propKey;\r\nvar __setFunctionName;\r\nvar __metadata;\r\nvar __awaiter;\r\nvar __generator;\r\nvar __exportStar;\r\nvar __values;\r\nvar __read;\r\nvar __spread;\r\nvar __spreadArrays;\r\nvar __spreadArray;\r\nvar __await;\r\nvar __asyncGenerator;\r\nvar __asyncDelegator;\r\nvar __asyncValues;\r\nvar __makeTemplateObject;\r\nvar __importStar;\r\nvar __importDefault;\r\nvar __classPrivateFieldGet;\r\nvar __classPrivateFieldSet;\r\nvar __classPrivateFieldIn;\r\nvar __createBinding;\r\nvar __addDisposableResource;\r\nvar __disposeResources;\r\nvar __rewriteRelativeImportExtension;\r\n(function (factory) {\r\n    var root = typeof global === \"object\" ? global : typeof self === \"object\" ? self : typeof this === \"object\" ? this : {};\r\n    if (typeof define === \"function\" && define.amd) {\r\n        define(\"tslib\", [\"exports\"], function (exports) { factory(createExporter(root, createExporter(exports))); });\r\n    }\r\n    else if (typeof module === \"object\" && typeof module.exports === \"object\") {\r\n        factory(createExporter(root, createExporter(module.exports)));\r\n    }\r\n    else {\r\n        factory(createExporter(root));\r\n    }\r\n    function createExporter(exports, previous) {\r\n        if (exports !== root) {\r\n            if (typeof Object.create === \"function\") {\r\n                Object.defineProperty(exports, \"__esModule\", { value: true });\r\n            }\r\n            else {\r\n                exports.__esModule = true;\r\n            }\r\n        }\r\n        return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };\r\n    }\r\n})\r\n(function (exporter) {\r\n    var extendStatics = Object.setPrototypeOf ||\r\n        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n        function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n\r\n    __extends = function (d, b) {\r\n        if (typeof b !== \"function\" && b !== null)\r\n            throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n        extendStatics(d, b);\r\n        function __() { this.constructor = d; }\r\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n    };\r\n\r\n    __assign = Object.assign || function (t) {\r\n        for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n            s = arguments[i];\r\n            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n        }\r\n        return t;\r\n    };\r\n\r\n    __rest = function (s, e) {\r\n        var t = {};\r\n        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n            t[p] = s[p];\r\n        if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n                    t[p[i]] = s[p[i]];\r\n            }\r\n        return t;\r\n    };\r\n\r\n    __decorate = function (decorators, target, key, desc) {\r\n        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n        if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n        return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n    };\r\n\r\n    __param = function (paramIndex, decorator) {\r\n        return function (target, key) { decorator(target, key, paramIndex); }\r\n    };\r\n\r\n    __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n        function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n        var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n        var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n        var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n        var _, done = false;\r\n        for (var i = decorators.length - 1; i >= 0; i--) {\r\n            var context = {};\r\n            for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n            for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n            context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n            var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n            if (kind === \"accessor\") {\r\n                if (result === void 0) continue;\r\n                if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n                if (_ = accept(result.get)) descriptor.get = _;\r\n                if (_ = accept(result.set)) descriptor.set = _;\r\n                if (_ = accept(result.init)) initializers.unshift(_);\r\n            }\r\n            else if (_ = accept(result)) {\r\n                if (kind === \"field\") initializers.unshift(_);\r\n                else descriptor[key] = _;\r\n            }\r\n        }\r\n        if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n        done = true;\r\n    };\r\n\r\n    __runInitializers = function (thisArg, initializers, value) {\r\n        var useValue = arguments.length > 2;\r\n        for (var i = 0; i < initializers.length; i++) {\r\n            value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n        }\r\n        return useValue ? value : void 0;\r\n    };\r\n\r\n    __propKey = function (x) {\r\n        return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n    };\r\n\r\n    __setFunctionName = function (f, name, prefix) {\r\n        if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n        return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n    };\r\n\r\n    __metadata = function (metadataKey, metadataValue) {\r\n        if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n    };\r\n\r\n    __awaiter = function (thisArg, _arguments, P, generator) {\r\n        function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n        return new (P || (P = Promise))(function (resolve, reject) {\r\n            function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n            function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n            function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n            step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n        });\r\n    };\r\n\r\n    __generator = function (thisArg, body) {\r\n        var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n        return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n        function verb(n) { return function (v) { return step([n, v]); }; }\r\n        function step(op) {\r\n            if (f) throw new TypeError(\"Generator is already executing.\");\r\n            while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n                if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n                if (y = 0, t) op = [op[0] & 2, t.value];\r\n                switch (op[0]) {\r\n                    case 0: case 1: t = op; break;\r\n                    case 4: _.label++; return { value: op[1], done: false };\r\n                    case 5: _.label++; y = op[1]; op = [0]; continue;\r\n                    case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n                    default:\r\n                        if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n                        if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n                        if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n                        if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n                        if (t[2]) _.ops.pop();\r\n                        _.trys.pop(); continue;\r\n                }\r\n                op = body.call(thisArg, _);\r\n            } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n            if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n        }\r\n    };\r\n\r\n    __exportStar = function(m, o) {\r\n        for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n    };\r\n\r\n    __createBinding = Object.create ? (function(o, m, k, k2) {\r\n        if (k2 === undefined) k2 = k;\r\n        var desc = Object.getOwnPropertyDescriptor(m, k);\r\n        if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n            desc = { enumerable: true, get: function() { return m[k]; } };\r\n        }\r\n        Object.defineProperty(o, k2, desc);\r\n    }) : (function(o, m, k, k2) {\r\n        if (k2 === undefined) k2 = k;\r\n        o[k2] = m[k];\r\n    });\r\n\r\n    __values = function (o) {\r\n        var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n        if (m) return m.call(o);\r\n        if (o && typeof o.length === \"number\") return {\r\n            next: function () {\r\n                if (o && i >= o.length) o = void 0;\r\n                return { value: o && o[i++], done: !o };\r\n            }\r\n        };\r\n        throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n    };\r\n\r\n    __read = function (o, n) {\r\n        var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n        if (!m) return o;\r\n        var i = m.call(o), r, ar = [], e;\r\n        try {\r\n            while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n        }\r\n        catch (error) { e = { error: error }; }\r\n        finally {\r\n            try {\r\n                if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n            }\r\n            finally { if (e) throw e.error; }\r\n        }\r\n        return ar;\r\n    };\r\n\r\n    /** @deprecated */\r\n    __spread = function () {\r\n        for (var ar = [], i = 0; i < arguments.length; i++)\r\n            ar = ar.concat(__read(arguments[i]));\r\n        return ar;\r\n    };\r\n\r\n    /** @deprecated */\r\n    __spreadArrays = function () {\r\n        for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n        for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n                r[k] = a[j];\r\n        return r;\r\n    };\r\n\r\n    __spreadArray = function (to, from, pack) {\r\n        if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n            if (ar || !(i in from)) {\r\n                if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n                ar[i] = from[i];\r\n            }\r\n        }\r\n        return to.concat(ar || Array.prototype.slice.call(from));\r\n    };\r\n\r\n    __await = function (v) {\r\n        return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n    };\r\n\r\n    __asyncGenerator = function (thisArg, _arguments, generator) {\r\n        if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n        var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n        return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n        function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n        function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n        function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n        function fulfill(value) { resume(\"next\", value); }\r\n        function reject(value) { resume(\"throw\", value); }\r\n        function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n    };\r\n\r\n    __asyncDelegator = function (o) {\r\n        var i, p;\r\n        return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n        function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n    };\r\n\r\n    __asyncValues = function (o) {\r\n        if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n        var m = o[Symbol.asyncIterator], i;\r\n        return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n        function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n    };\r\n\r\n    __makeTemplateObject = function (cooked, raw) {\r\n        if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n        return cooked;\r\n    };\r\n\r\n    var __setModuleDefault = Object.create ? (function(o, v) {\r\n        Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n    }) : function(o, v) {\r\n        o[\"default\"] = v;\r\n    };\r\n\r\n    var ownKeys = function(o) {\r\n        ownKeys = Object.getOwnPropertyNames || function (o) {\r\n            var ar = [];\r\n            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n            return ar;\r\n        };\r\n        return ownKeys(o);\r\n    };\r\n\r\n    __importStar = function (mod) {\r\n        if (mod && mod.__esModule) return mod;\r\n        var result = {};\r\n        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n        __setModuleDefault(result, mod);\r\n        return result;\r\n    };\r\n\r\n    __importDefault = function (mod) {\r\n        return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n    };\r\n\r\n    __classPrivateFieldGet = function (receiver, state, kind, f) {\r\n        if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n        if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n        return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n    };\r\n\r\n    __classPrivateFieldSet = function (receiver, state, value, kind, f) {\r\n        if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n        if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n        if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n        return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n    };\r\n\r\n    __classPrivateFieldIn = function (state, receiver) {\r\n        if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n        return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n    };\r\n\r\n    __addDisposableResource = function (env, value, async) {\r\n        if (value !== null && value !== void 0) {\r\n            if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n            var dispose, inner;\r\n            if (async) {\r\n                if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n                dispose = value[Symbol.asyncDispose];\r\n            }\r\n            if (dispose === void 0) {\r\n                if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n                dispose = value[Symbol.dispose];\r\n                if (async) inner = dispose;\r\n            }\r\n            if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n            if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n            env.stack.push({ value: value, dispose: dispose, async: async });\r\n        }\r\n        else if (async) {\r\n            env.stack.push({ async: true });\r\n        }\r\n        return value;\r\n    };\r\n\r\n    var _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n        var e = new Error(message);\r\n        return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n    };\r\n\r\n    __disposeResources = function (env) {\r\n        function fail(e) {\r\n            env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n            env.hasError = true;\r\n        }\r\n        var r, s = 0;\r\n        function next() {\r\n            while (r = env.stack.pop()) {\r\n                try {\r\n                    if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n                    if (r.dispose) {\r\n                        var result = r.dispose.call(r.value);\r\n                        if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n                    }\r\n                    else s |= 1;\r\n                }\r\n                catch (e) {\r\n                    fail(e);\r\n                }\r\n            }\r\n            if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n            if (env.hasError) throw env.error;\r\n        }\r\n        return next();\r\n    };\r\n\r\n    __rewriteRelativeImportExtension = function (path, preserveJsx) {\r\n        if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n            return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n                return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n            });\r\n        }\r\n        return path;\r\n    };\r\n\r\n    exporter(\"__extends\", __extends);\r\n    exporter(\"__assign\", __assign);\r\n    exporter(\"__rest\", __rest);\r\n    exporter(\"__decorate\", __decorate);\r\n    exporter(\"__param\", __param);\r\n    exporter(\"__esDecorate\", __esDecorate);\r\n    exporter(\"__runInitializers\", __runInitializers);\r\n    exporter(\"__propKey\", __propKey);\r\n    exporter(\"__setFunctionName\", __setFunctionName);\r\n    exporter(\"__metadata\", __metadata);\r\n    exporter(\"__awaiter\", __awaiter);\r\n    exporter(\"__generator\", __generator);\r\n    exporter(\"__exportStar\", __exportStar);\r\n    exporter(\"__createBinding\", __createBinding);\r\n    exporter(\"__values\", __values);\r\n    exporter(\"__read\", __read);\r\n    exporter(\"__spread\", __spread);\r\n    exporter(\"__spreadArrays\", __spreadArrays);\r\n    exporter(\"__spreadArray\", __spreadArray);\r\n    exporter(\"__await\", __await);\r\n    exporter(\"__asyncGenerator\", __asyncGenerator);\r\n    exporter(\"__asyncDelegator\", __asyncDelegator);\r\n    exporter(\"__asyncValues\", __asyncValues);\r\n    exporter(\"__makeTemplateObject\", __makeTemplateObject);\r\n    exporter(\"__importStar\", __importStar);\r\n    exporter(\"__importDefault\", __importDefault);\r\n    exporter(\"__classPrivateFieldGet\", __classPrivateFieldGet);\r\n    exporter(\"__classPrivateFieldSet\", __classPrivateFieldSet);\r\n    exporter(\"__classPrivateFieldIn\", __classPrivateFieldIn);\r\n    exporter(\"__addDisposableResource\", __addDisposableResource);\r\n    exporter(\"__disposeResources\", __disposeResources);\r\n    exporter(\"__rewriteRelativeImportExtension\", __rewriteRelativeImportExtension);\r\n});\r\n\r\n0 && (module.exports = {\r\n    __extends: __extends,\r\n    __assign: __assign,\r\n    __rest: __rest,\r\n    __decorate: __decorate,\r\n    __param: __param,\r\n    __esDecorate: __esDecorate,\r\n    __runInitializers: __runInitializers,\r\n    __propKey: __propKey,\r\n    __setFunctionName: __setFunctionName,\r\n    __metadata: __metadata,\r\n    __awaiter: __awaiter,\r\n    __generator: __generator,\r\n    __exportStar: __exportStar,\r\n    __createBinding: __createBinding,\r\n    __values: __values,\r\n    __read: __read,\r\n    __spread: __spread,\r\n    __spreadArrays: __spreadArrays,\r\n    __spreadArray: __spreadArray,\r\n    __await: __await,\r\n    __asyncGenerator: __asyncGenerator,\r\n    __asyncDelegator: __asyncDelegator,\r\n    __asyncValues: __asyncValues,\r\n    __makeTemplateObject: __makeTemplateObject,\r\n    __importStar: __importStar,\r\n    __importDefault: __importDefault,\r\n    __classPrivateFieldGet: __classPrivateFieldGet,\r\n    __classPrivateFieldSet: __classPrivateFieldSet,\r\n    __classPrivateFieldIn: __classPrivateFieldIn,\r\n    __addDisposableResource: __addDisposableResource,\r\n    __disposeResources: __disposeResources,\r\n    __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n});\r\n\n}).call(this)}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],316:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BattleGameState = void 0;\nconst tslib_1 = require(\"tslib\");\n/** @module GameContexts */\nconst inversify_1 = require(\"inversify\");\nconst gameContext_1 = require(\"../gameContext\");\nconst symbols_1 = require(\"../symbols\");\nconst types_1 = require(\"../types\");\n/** @public */\nlet BattleGameState = class BattleGameState extends gameContext_1.GameContextState {\n    constructor(pathService, battleService, playerService) {\n        super();\n        this.pathService = pathService;\n        this.battleService = battleService;\n        this.playerService = playerService;\n    }\n    getStateName() {\n        return gameContext_1.GameContextEnum.battle;\n    }\n    getAvailableActionNames() {\n        return [\"getUserAvailableHeroes\", \"endBattleHook\", \"changeState\", \"isBattleEnded\", \"getEnemies\"];\n    }\n    setContextState(state) {\n        this.battleId = state.state.battleId;\n    }\n    /**\n     * @public\n     *\n     * Returns enemies positions for the battle (all waves at once)\n     */\n    getEnemies() {\n        if (this.battleId == null) {\n            return { error: true, key: types_1.ErrorKey.BrokenState, details: \"in battle, but unknown battleId\" };\n        }\n        return this.battleService.getEnemies(this.battleId);\n    }\n    /**\n     * @public\n     *\n     * Returns user's heroes available for the battle\n     */\n    getUserAvailableHeroes() {\n        return this.playerService.getUserHeroes().map((h) => h.toDto());\n    }\n    /** @public */\n    endBattleHook(isUserWon) {\n        if (this.battleId == null) {\n            return { error: true, key: types_1.ErrorKey.BrokenState, details: \"endBattleHook called, but battleId is unknown\" };\n        }\n        if (isUserWon) {\n            this.pathService.eventFinishedHook(this.battleId);\n        }\n        return {\n            isUserWon,\n        };\n    }\n    /** @public */\n    changeState(newState, stateParam) {\n        this.battleId = undefined;\n        if (newState === gameContext_1.GameContextEnum.init) {\n            return { error: true, key: types_1.ErrorKey.ValidationError, details: \"can't change to init\" };\n        }\n        if (newState === gameContext_1.GameContextEnum.battle) {\n            if (stateParam == null) {\n                return {\n                    error: true,\n                    key: types_1.ErrorKey.ValidationError,\n                    details: \"you want ot change to battle, but no batle id provided\",\n                };\n            }\n            this.changeGameContextTo({ contextName: newState, state: { battleId: stateParam } });\n        }\n        else {\n            this.changeGameContextTo({ contextName: newState });\n        }\n        return { error: false };\n    }\n    /** @public */\n    isBattleEnded() {\n        return false;\n    }\n    /**\n     * @public\n     * replay current step\n     * enter battle if you are not in the battle\n     */\n    getCurrentStep() {\n        return this.pathService.getCurrentStep();\n    }\n};\nexports.BattleGameState = BattleGameState;\nexports.BattleGameState = BattleGameState = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.IPathService)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.IBattleService)),\n    tslib_1.__param(2, (0, inversify_1.inject)(symbols_1.Symbols.IPlayerService))\n], BattleGameState);\n\n},{\"../gameContext\":336,\"../symbols\":351,\"../types\":356,\"inversify\":278,\"tslib\":315}],317:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultGameState = void 0;\nconst tslib_1 = require(\"tslib\");\n/** @module GameContexts */\nconst inversify_1 = require(\"inversify\");\nconst gameContext_1 = require(\"../gameContext\");\nconst symbols_1 = require(\"../symbols\");\nconst types_1 = require(\"../types\");\nconst types_2 = require(\"../../types\");\n/** @public */\nlet DefaultGameState = class DefaultGameState extends gameContext_1.GameContextState {\n    constructor(featureToggleService, rewardsGenerator, playerService, inventoryService, heroService, pathService, sleepService, player, inventoryEntity, rewardManager, resourceManager) {\n        super();\n        this.featureToggleService = featureToggleService;\n        this.rewardsGenerator = rewardsGenerator;\n        this.playerService = playerService;\n        this.inventoryService = inventoryService;\n        this.heroService = heroService;\n        this.pathService = pathService;\n        this.sleepService = sleepService;\n        this.player = player;\n        this.inventoryEntity = inventoryEntity;\n        this.rewardManager = rewardManager;\n        this.resourceManager = resourceManager;\n    }\n    getStateName() {\n        return gameContext_1.GameContextEnum.default;\n    }\n    getAvailableActionNames() {\n        return [\n            \"carouselSpin\",\n            \"claimSheep\",\n            \"claimFurniture\",\n            \"countResourcesToLevelUpHero\",\n            \"countResourcesToStarUpHero\",\n            \"preClaimSleep\",\n            \"claimSleep\",\n            \"go\",\n            \"endStepHook\",\n            \"levelUpHero\",\n            \"freeLevelUpHero\",\n            \"preClaimSheep\",\n            \"setFeature\",\n            \"setPathStage\",\n            \"starUpHero\",\n            \"updateSleepSchedule\",\n            \"changeState\",\n            \"getCurrentStep\",\n            \"getInventoryItems\",\n            \"claimIdler\",\n            \"buyStreakFreeze\",\n            \"restoreStreak\",\n            \"testSwitchBattles\",\n            \"testMoveLastStreakClaim\",\n            \"testAssignStreak\",\n            \"testTeleport\",\n            \"testAddResource\",\n            \"testAddResourceForMaxLevelsHero\",\n            \"testAddInventoryItem\",\n            \"testGetFullSleepInfo\",\n            \"testSleep\",\n            \"testMoveSleepDayBack\",\n            \"updateGameState\",\n        ];\n    }\n    setContextState() { }\n    /** @public  */\n    claimIdler() {\n        return this.playerService.claimIdler();\n    }\n    /** @public  */\n    carouselSpin() {\n        return this.pathService.carouselSpin();\n    }\n    /**\n     * @public\n     *\n     * @param heroType\n     *\n     * count resources needed to level up hero\n     */\n    countResourcesToLevelUpHero(heroType) {\n        return this.heroService.countResourcesToLevelUpHero(heroType);\n    }\n    /**\n     * @public\n     *\n     * @param heroType\n     *\n     * level up hero\n     */\n    levelUpHero(heroType) {\n        return this.heroService.levelUpHero(heroType, false);\n    }\n    /**\n     * @public\n     *\n     * @param heroType\n     *\n     * free level up hero (for equilibrium)\n     */\n    freeLevelUpHero(heroType) {\n        return this.heroService.levelUpHero(heroType, true);\n    }\n    /**\n     * @public\n     *\n     * @param heroType\n     *\n     * count resources needed to stars up hero\n     */\n    countResourcesToStarUpHero(heroType) {\n        return this.heroService.countResourcesToStarUpHero(heroType);\n    }\n    /**\n     * @public\n     *\n     * @param heroType\n     *\n     * star up hero\n     */\n    starUpHero(heroType) {\n        return this.heroService.starUpHero(heroType);\n    }\n    /**\n     * @public\n     * make step in Path\n     *\n     * @returns step rewards and their variants\n     */\n    go() {\n        const currentStep = this.pathService.getCurrentStep();\n        if (currentStep.error) {\n            return currentStep;\n        }\n        if (currentStep.event !== types_2.GoEventType.battle) {\n            this.pathService.eventFinishedHook(currentStep.eventParameter);\n        }\n        const result = this.pathService.go();\n        if (result === null || result === void 0 ? void 0 : result.error) {\n            return result;\n        }\n        const { event, eventParameter } = result;\n        if (event !== types_2.GoEventType.battle) {\n            this.pathService.eventFinishedHook(eventParameter);\n        }\n        if (event === types_2.GoEventType.carousel) {\n            this.player.addHiddenResource(types_2.HiddenResourceType.carouselTicket);\n        }\n        return result;\n    }\n    /** @public */\n    changeState(newState, stateParam) {\n        if (newState === gameContext_1.GameContextEnum.init) {\n            return { error: true, key: types_1.ErrorKey.ValidationError, details: \"can't change to init\" };\n        }\n        if (newState === gameContext_1.GameContextEnum.battle) {\n            if (stateParam == null) {\n                return {\n                    error: true,\n                    key: types_1.ErrorKey.ValidationError,\n                    details: \"you want ot change to battle, but no batle id provided\",\n                };\n            }\n            const currentStep = this.pathService.getCurrentStep();\n            if (currentStep === null || currentStep === void 0 ? void 0 : currentStep.error) {\n                return currentStep;\n            }\n            const { event, eventParameter } = currentStep;\n            if (event !== types_2.GoEventType.battle || eventParameter == null || eventParameter !== stateParam) {\n                return { error: true, key: types_1.ErrorKey.ValidationError, details: \"battleId is not for current battle\" };\n            }\n            this.changeGameContextTo({ contextName: newState, state: { battleId: stateParam } });\n        }\n        else {\n            this.changeGameContextTo({ contextName: newState });\n        }\n        return { error: false };\n    }\n    /**\n     * @public\n     * replay current step\n     * enter battle if you are not in the battle\n     */\n    getCurrentStep() {\n        const currentStep = this.pathService.getCurrentStep();\n        if (currentStep.error) {\n            return currentStep;\n        }\n        if (currentStep.event !== types_2.GoEventType.battle) {\n            this.pathService.eventFinishedHook(currentStep.eventParameter);\n        }\n        return currentStep;\n    }\n    /** @public */\n    endStepHook() {\n        return this.pathService.endStepHook();\n    }\n    /** @public */\n    setPathStage(pathStage) {\n        this.player.setPathInfo({ pathStage });\n        return this.playerService.getPlayerInfo();\n    }\n    /** @public */\n    testTeleport(...args) {\n        this.pathService.teleport(...args);\n    }\n    /**\n     * @public\n     *\n     * @param itemType\n     * get items of certain type from inventory\n     */\n    getInventoryItems(itemType) {\n        return this.inventoryService.getAllByType(itemType);\n    }\n    /** @public */\n    testSwitchBattles(enable = !this.rewardsGenerator.getBattleEnabled()) {\n        this.rewardsGenerator.setBattleEnabled(enable);\n    }\n    /** @public */\n    testAddResourceForMaxLevelsHero() {\n        const heroes = this.player.getUserHeroes();\n        // eslint-disable-next-line @typescript-eslint/prefer-for-of\n        for (let i = 0; i < heroes.length; i++) {\n            const firstLevel = heroes[i].level;\n            let neededNumberOfLevelIncreasesForMaximum = 500 - firstLevel;\n            do {\n                const currentLevel = 500 - neededNumberOfLevelIncreasesForMaximum;\n                const resourcesToLevelUp = this.heroService.getLevelUpCost(currentLevel);\n                if (resourcesToLevelUp.gold != null)\n                    this.testAddResource(types_2.ResourceType.gold, resourcesToLevelUp.gold);\n                if (resourcesToLevelUp.greenMoonDrop != null) {\n                    this.testAddResource(types_2.ResourceType.greenMoonDrop, resourcesToLevelUp.greenMoonDrop);\n                }\n                if (resourcesToLevelUp.purpleMoonDrop != null) {\n                    this.testAddResource(types_2.ResourceType.purpleMoonDrop, resourcesToLevelUp.purpleMoonDrop);\n                }\n                neededNumberOfLevelIncreasesForMaximum--;\n            } while (neededNumberOfLevelIncreasesForMaximum > 0);\n        }\n    }\n    /**\n     * @public\n     *\n     * @param resourceType\n     * @param amount\n     * @param {HeroType} [heroType] - use only for hero cards\n     * [cheat] add resources (any type, except equipment)\n     */\n    testAddResource(resourceType, amount, heroType, heroRarity, sleepBoxLevel, furnitureId) {\n        switch (resourceType) {\n            case types_2.ResourceType.gold:\n                this.player.addGold(amount);\n                return [\n                    {\n                        type: resourceType,\n                        variant: { amount },\n                    },\n                ];\n            case types_2.ResourceType.gem:\n                this.player.addGems(amount);\n                return [\n                    {\n                        type: resourceType,\n                        variant: { amount },\n                    },\n                ];\n            case types_2.ResourceType.xp:\n                this.player.addExperience(amount);\n                return [\n                    {\n                        type: resourceType,\n                        variant: { amount },\n                    },\n                ];\n            case types_2.ResourceType.greenMoonDrop:\n                this.inventoryEntity.addResource({ resourceType: types_2.ResourceType.greenMoonDrop }, amount);\n                return [\n                    {\n                        type: resourceType,\n                        variant: { amount },\n                    },\n                ];\n            case types_2.ResourceType.purpleMoonDrop:\n                this.inventoryEntity.addResource({ resourceType: types_2.ResourceType.purpleMoonDrop }, amount);\n                return [\n                    {\n                        type: resourceType,\n                        variant: { amount },\n                    },\n                ];\n            case types_2.ResourceType.streakFreeze:\n                this.inventoryEntity.addResource({ resourceType: types_2.ResourceType.streakFreeze }, amount);\n                return [\n                    {\n                        type: resourceType,\n                        variant: { amount },\n                    },\n                ];\n            case types_2.ResourceType.gachaToken:\n                this.inventoryEntity.addResource({ resourceType: types_2.ResourceType.gachaToken }, amount);\n                return [\n                    {\n                        type: resourceType,\n                        variant: { amount },\n                    },\n                ];\n            case types_2.ResourceType.heroCard:\n                return Array.from({ length: amount }).map(() => this.rewardManager.applyReward({\n                    type: types_2.ResourceType.heroCard,\n                    payload: { heroType: heroType !== null && heroType !== void 0 ? heroType : this.rewardsGenerator.generateHeroCard().heroType },\n                }));\n            case types_2.ResourceType.heroStarDust:\n                return [\n                    this.rewardManager.applyReward({\n                        type: types_2.ResourceType.heroStarDust,\n                        payload: heroRarity != null ? { heroRarity } : this.rewardsGenerator.generateHeroStarDust(),\n                        amount,\n                    }),\n                ];\n            case types_2.ResourceType.furniture:\n                if (furnitureId == null) {\n                    return {\n                        error: true,\n                        key: types_1.ErrorKey.ValidationError,\n                        details: \"furnitureId is required\",\n                    };\n                }\n                return [\n                    this.rewardManager.applyReward({\n                        type: types_2.ResourceType.furniture,\n                        payload: Object.assign(Object.assign({}, this.resourceManager.parseFurnitureId(furnitureId)), { isSelectable: false, isClaimed: false }),\n                    }),\n                ];\n            case types_2.BoxType.sleepBox:\n                return Array.from({ length: amount }).flatMap(() => this.rewardsGenerator\n                    .generateSleepBoxContent(sleepBoxLevel !== null && sleepBoxLevel !== void 0 ? sleepBoxLevel : 1)\n                    .map((item) => this.rewardManager.applyReward(item)));\n            case types_2.ResourceType.vSleep:\n                this.player.addVSleep(amount);\n                return [\n                    {\n                        type: resourceType,\n                        variant: { amount },\n                    },\n                ];\n            default:\n                return {\n                    error: true,\n                    key: types_1.ErrorKey.ValidationError,\n                    details: \"not implemented\",\n                };\n        }\n    }\n    /**\n     * @public\n     * Set flag value;\n     */\n    setFeature({ flag, value }) {\n        this.featureToggleService.setFeatureValue(flag, value);\n    }\n    /** @public */\n    claimFurniture(furnitureId) {\n        return this.sleepService.claimFurniture(furnitureId);\n    }\n    /** @public */\n    claimSheep(rawSleepData) {\n        return this.sleepService.claimSheep(rawSleepData);\n    }\n    /** @public */\n    preClaimSheep(rawSleepData) {\n        return this.sleepService.preClaimSheep(rawSleepData);\n    }\n    /** @public */\n    claimSleep(rawSleepData) {\n        return this.sleepService.claimSleep(rawSleepData);\n    }\n    /** @public */\n    preClaimSleep(rawSleepData) {\n        return this.sleepService.preClaimSleep(rawSleepData);\n    }\n    /** @public */\n    updateSleepSchedule(sleepSchedule) {\n        return this.sleepService.updateSleepSchedule(sleepSchedule);\n    }\n    /** @public */\n    buyStreakFreeze(amount) {\n        return this.sleepService.buyStreakFreeze(amount);\n    }\n    /** @public */\n    restoreStreak() {\n        return this.sleepService.restoreStreak();\n    }\n    /** @public */\n    testMoveLastStreakClaim(days = 1) {\n        return this.sleepService.testMoveLastStreakClaim(days);\n    }\n    /** @public */\n    testAssignStreak(days) {\n        if (!types_2.NonNegIntGuard.guard(days)) {\n            return {\n                error: true,\n                key: types_1.ErrorKey.ValidationError,\n                details: types_2.NonNegIntGuard.errors(days),\n            };\n        }\n        return this.sleepService.testAssignStreak(days);\n    }\n    /** @public */\n    testMoveSleepDayBack(days = 1) {\n        return this.sleepService.testMoveSleepDayBack(days);\n    }\n    /** @public */\n    testSleep(quality) {\n        return this.sleepService.testSleep(quality);\n    }\n    // --- for bundle compatability with rest api --- //\n    /** @public */\n    updateGameState(updates, restPath) {\n        const { add, update, spend } = updates;\n        for (const resourceType of Object.keys(add)) {\n            if (resourceType === types_2.ResourceType.heroCard) {\n                // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n                for (const [heroType, amount] of Object.entries(add[resourceType])) {\n                    Array.from({ length: parseInt(amount) }).map(() => this.rewardManager.applyReward({\n                        type: types_2.ResourceType.heroCard,\n                        payload: { heroType },\n                    }));\n                }\n            }\n            else if (resourceType === types_2.ResourceType.furniture) {\n                // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n                for (const furnitureId of add[resourceType]) {\n                    this.rewardManager.applyReward({\n                        type: types_2.ResourceType.furniture,\n                        payload: Object.assign(Object.assign({}, this.resourceManager.parseFurnitureId(furnitureId)), { isSelectable: false, isClaimed: false }),\n                    });\n                }\n            }\n            // TODO: Remove this code block after implementing nested parsing of RESTToBundleOutput objects on Unity side:\n            else if (resourceType === \"extras_redeem_code_supporter_pack\") {\n                Array.from({ length: 65 }).map(() => this.rewardManager.applyReward({\n                    type: types_2.ResourceType.heroCard,\n                    payload: { heroType: types_1.HeroType.dino },\n                }));\n                this.rewardManager.applyReward({\n                    type: types_2.ResourceType.furniture,\n                    payload: Object.assign(Object.assign({}, this.resourceManager.parseFurnitureId(\"bed_type_4_lvl_4\")), { isSelectable: false, isClaimed: false }),\n                });\n            }\n            else {\n                // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n                this.testAddResource(resourceType, parseInt(add[resourceType]));\n            }\n        }\n        for (const resourceType of Object.keys(spend)) {\n            switch (resourceType) {\n                case types_2.ResourceType.gem:\n                    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n                    this.player.spendGems(parseInt(spend[resourceType]));\n                    break;\n                case types_2.ResourceType.gold:\n                    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n                    this.player.spendGold(parseInt(spend[resourceType]));\n                    break;\n                case types_2.ResourceType.vSleep:\n                    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n                    this.player.spendVSleep(parseInt(spend[resourceType]));\n                    break;\n                case types_2.ResourceType.greenMoonDrop:\n                case types_2.ResourceType.purpleMoonDrop:\n                case types_2.ResourceType.gachaToken:\n                    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n                    this.inventoryEntity.spendResource(resourceType, parseInt(spend[resourceType]));\n                    break;\n                default:\n                    return {\n                        error: true,\n                        key: types_1.ErrorKey.ValidationError,\n                        details: \"not implemented\",\n                    };\n            }\n        }\n        if (update.freeGachaLastClaim != null) {\n            this.player.setMeta({ freeGachaLastClaim: update.freeGachaLastClaim });\n        }\n        if (update.username != null) {\n            this.player.setUsername(update.username);\n        }\n        if (update.supporterPackPurchasedAt != null) {\n            this.player.setSupporterPackPurchasedAt(update.supporterPackPurchasedAt);\n        }\n        if (update.solanaAddress != null) {\n            this.player.setSolanaAddress(update.solanaAddress);\n        }\n        if (update.isReferral != null) {\n            this.player.setMeta({ isReferral: update.isReferral });\n        }\n        if (update.lastShareVSleepClaimDate != null) {\n            this.player.setMeta({ lastShareVSleepClaimDate: update.lastShareVSleepClaimDate });\n        }\n        if (update.currentStreakDays != null) {\n            this.sleepService.testAssignStreak(update.currentStreakDays);\n        }\n        return updates;\n    }\n    // --- available only in auto test; for dev usage only ----//\n    testAddInventoryItem(item, amount) {\n        return this.inventoryService.addInventoryitem(item, amount);\n    }\n    testGetFullSleepInfo() {\n        return this.sleepService.getFullSleepInfo();\n    }\n};\nexports.DefaultGameState = DefaultGameState;\nexports.DefaultGameState = DefaultGameState = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.IFeatureToggleService)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.IRewardsGenerator)),\n    tslib_1.__param(2, (0, inversify_1.inject)(symbols_1.Symbols.IPlayerService)),\n    tslib_1.__param(3, (0, inversify_1.inject)(symbols_1.Symbols.IInventoryService)),\n    tslib_1.__param(4, (0, inversify_1.inject)(symbols_1.Symbols.IHeroService)),\n    tslib_1.__param(5, (0, inversify_1.inject)(symbols_1.Symbols.IPathService)),\n    tslib_1.__param(6, (0, inversify_1.inject)(symbols_1.Symbols.ISleepService)),\n    tslib_1.__param(7, (0, inversify_1.inject)(symbols_1.Symbols.IPlayerEntity)),\n    tslib_1.__param(8, (0, inversify_1.inject)(symbols_1.Symbols.IInventoryEntity)),\n    tslib_1.__param(9, (0, inversify_1.inject)(symbols_1.Symbols.IRewardManager)),\n    tslib_1.__param(10, (0, inversify_1.inject)(symbols_1.Symbols.IResourceManager))\n], DefaultGameState);\n\n},{\"../../types\":367,\"../gameContext\":336,\"../symbols\":351,\"../types\":356,\"inversify\":278,\"tslib\":315}],318:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GameGlobalState = void 0;\nconst tslib_1 = require(\"tslib\");\n/** @module GameContexts */\nconst inversify_1 = require(\"inversify\");\nconst gameContext_1 = require(\"../gameContext\");\nconst symbols_1 = require(\"../symbols\");\n/** @public */\nlet GameGlobalState = class GameGlobalState {\n    constructor(playerService, gameState, inventoryEntity, pathService, configManager, player) {\n        this.playerService = playerService;\n        this.gameState = gameState;\n        this.inventoryEntity = inventoryEntity;\n        this.pathService = pathService;\n        this.configManager = configManager;\n        this.player = player;\n    }\n    getAvailableActionNames() {\n        return [\n            \"saveGame\",\n            \"savedGameHook\",\n            \"getPlayerInfo\",\n            \"getDialogue\",\n            \"getHeroesList\",\n            \"getAllHeroesCollection\",\n            \"getPathLegend\",\n            \"getConfigsNeeded\",\n            \"addConfigs\",\n            \"testSetStage\",\n        ];\n    }\n    /**\n     * @public\n     *\n     * save game progress\n     *\n     * @returns stringified representation of game state object. Usually called gameStateDump;\n     */\n    saveGame() {\n        const _a = this.gameState, { _configs } = _a, gameStateWithoutRuntime = tslib_1.__rest(_a, [\"_configs\"]);\n        gameStateWithoutRuntime.player.inventory = this.inventoryEntity.dump();\n        return JSON.stringify(gameStateWithoutRuntime);\n    }\n    /** @public */\n    savedGameHook() {\n        /*\n          user can have a very long game session, during witch he will perform multiple \"saves\".\n          in order to maintain correct data versioning we will increase dataVersion after each save\n          also - after each save we will transfer logs (called \"appliedActions\") to the db and empty corresponding array in bundle\n          all logs, received within a single \"save\" action will be located in _sessions array.\n          if we will not clean logs after each save we will have two problems\n          1. bundle memory leakage\n          2. in db in _sessions we will have repeated data\n        */\n        this.gameState._dataVersion += 1;\n        this.gameState.appliedActions = [];\n        return { _dataVersion: this.gameState._dataVersion };\n    }\n    /** @public */\n    getPlayerInfo() {\n        return this.playerService.getPlayerInfo();\n    }\n    /** @public */\n    getDialogue(dialogueId) {\n        return this.pathService.getDialogue(dialogueId);\n    }\n    /**\n     * @public\n     *\n     * get list of heroes owned by user\n     */\n    getHeroesList() {\n        return this.playerService.getUserHeroes().map((hero) => hero.toDto());\n    }\n    /**\n     * @public\n     *\n     * get all heroes in the game\n     */\n    getAllHeroesCollection() {\n        return this.configManager\n            .getConfig(\"base\")\n            .heroesConfig.heroes.filter((el) => !el.heroType.startsWith(\"tutorial\") && el.gachable)\n            .map((el) => ({\n            heroType: el.heroType,\n            heroClass: el.heroClass,\n            name: el.name,\n            heroRarity: el.heroRarity,\n            element: el.element,\n        }));\n    }\n    /**\n     * @public\n     * @param pathId - id of the path you ask legend for\n     * @returns path legend - array of path steps with additional data\n     */\n    getPathLegend(pathId) {\n        return this.pathService.getPathLegend();\n    }\n    /** @public */\n    getCurrentStateName() {\n        return gameContext_1.GameContextEnum.default;\n    }\n    getConfigsNeeded() {\n        return this.configManager.getConfigsNeeded();\n    }\n    addConfigs(data) {\n        this.configManager.addConfigs(data);\n    }\n    /**\n     * Cheat to change the stage during the hunt\n     * @public\n     */\n    testSetStage(newStage) {\n        this.configManager.getHuntStageConfig(newStage);\n        this.player.huntChangeStage(newStage);\n    }\n};\nexports.GameGlobalState = GameGlobalState;\nexports.GameGlobalState = GameGlobalState = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.IPlayerService)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.InitialGameState)),\n    tslib_1.__param(2, (0, inversify_1.inject)(symbols_1.Symbols.IInventoryEntity)),\n    tslib_1.__param(3, (0, inversify_1.inject)(symbols_1.Symbols.IPathService)),\n    tslib_1.__param(4, (0, inversify_1.inject)(symbols_1.Symbols.IConfigManager)),\n    tslib_1.__param(5, (0, inversify_1.inject)(symbols_1.Symbols.IPlayerEntity))\n], GameGlobalState);\n\n},{\"../gameContext\":336,\"../symbols\":351,\"inversify\":278,\"tslib\":315}],319:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HuntGameState = void 0;\nconst tslib_1 = require(\"tslib\");\n/** @module GameContexts */\nconst inversify_1 = require(\"inversify\");\nconst gameContext_1 = require(\"../gameContext\");\nconst symbols_1 = require(\"../symbols\");\nconst types_1 = require(\"../types\");\nconst types_2 = require(\"../../types\");\n/** @public */\nlet HuntGameState = class HuntGameState extends gameContext_1.GameContextState {\n    constructor(rewardsGenerator, configManager, player, heroFactory, playerService, rewardManager, pathService) {\n        super();\n        this.rewardsGenerator = rewardsGenerator;\n        this.configManager = configManager;\n        this.player = player;\n        this.heroFactory = heroFactory;\n        this.playerService = playerService;\n        this.rewardManager = rewardManager;\n        this.pathService = pathService;\n    }\n    getStateName() {\n        return gameContext_1.GameContextEnum.hunt;\n    }\n    getAvailableActionNames() {\n        return [\"getEnemies\", \"getHuntInfo\", \"endBattleHook\", \"changeState\"];\n    }\n    setContextState(state) { }\n    /**\n     * @public\n     *\n     * Returns enemies positions for the battle (all waves at once)\n     */\n    getEnemies() {\n        const stage = this.player.getHuntInfo().stage;\n        const maxStage = this.configManager.getHuntMaxStage();\n        if (stage > maxStage)\n            return [];\n        const stageConfig = this.configManager.getHuntStageConfig(stage);\n        const config = this.configManager.getBattle(stageConfig.battle);\n        if (config == null) {\n            throw new Error(`Invalid battle configId: ${stageConfig.battle}`);\n        }\n        return [\n            config.map((enemyConfig) => {\n                const enemy = this.heroFactory.createForDeck({\n                    heroType: enemyConfig.character,\n                    level: enemyConfig.level,\n                    stars: 1,\n                });\n                return Object.assign(Object.assign({}, enemy.toDto()), { position: { x: enemyConfig.x, y: enemyConfig.y } });\n            }),\n        ];\n    }\n    /** @public */\n    getHuntInfo() {\n        const stage = this.player.getHuntInfo().stage;\n        const maxStage = this.configManager.getHuntMaxStage();\n        const enemies = this.getEnemies();\n        return {\n            stage,\n            maxStage,\n            finished: stage > maxStage,\n            enemies,\n        };\n    }\n    /** @public */\n    endBattleHook(isUserWon) {\n        const stage = this.player.getHuntInfo().stage;\n        const maxStage = this.configManager.getHuntMaxStage();\n        if (stage > maxStage) {\n            return {\n                error: true,\n                key: types_1.ErrorKey.BrokenState,\n                details: \"current stage >= maxStage, but endBattleHook called\",\n            };\n        }\n        const stageConfig = this.configManager.getHuntStageConfig(stage);\n        if (!isUserWon) {\n            return { isUserWon, levelUp: false, rewards: [] };\n        }\n        this.player.huntChangeStage(stage + 1);\n        if (stageConfig.reward != null) {\n            const { level: levelBefore } = this.playerService.getLevelInfo();\n            const rewardsPack = this.rewardsGenerator.generatePackRewards(stageConfig.reward);\n            const appliedRewards = rewardsPack.map((r) => this.rewardManager.applyReward(r));\n            const { level: levelAfter } = this.playerService.getLevelInfo();\n            return {\n                isUserWon,\n                levelUp: levelAfter > levelBefore,\n                rewards: appliedRewards,\n            };\n        }\n        return {\n            isUserWon,\n            levelUp: false,\n            rewards: [],\n        };\n    }\n    /** @public */\n    changeState(newState, stateParam) {\n        if (newState === gameContext_1.GameContextEnum.init) {\n            return { error: true, key: types_1.ErrorKey.ValidationError, details: \"can't change to init\" };\n        }\n        else if (newState === gameContext_1.GameContextEnum.hunt) {\n            return { error: true, key: types_1.ErrorKey.ValidationError, details: \"already in hunt\" };\n        }\n        else if (newState === gameContext_1.GameContextEnum.battle) {\n            if (stateParam == null) {\n                return {\n                    error: true,\n                    key: types_1.ErrorKey.ValidationError,\n                    details: \"you want ot change to battle, but no batle id provided\",\n                };\n            }\n            const currentStep = this.pathService.getCurrentStep();\n            if (currentStep === null || currentStep === void 0 ? void 0 : currentStep.error) {\n                return currentStep;\n            }\n            const { event, eventParameter } = currentStep;\n            if (event !== types_2.GoEventType.battle || eventParameter == null || eventParameter !== stateParam) {\n                return { error: true, key: types_1.ErrorKey.ValidationError, details: \"battleId is not for current battle\" };\n            }\n            this.changeGameContextTo({ contextName: newState, state: { battleId: stateParam } });\n        }\n        else {\n            this.changeGameContextTo({ contextName: newState });\n        }\n        return { error: false };\n    }\n};\nexports.HuntGameState = HuntGameState;\nexports.HuntGameState = HuntGameState = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.IRewardsGenerator)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.IConfigManager)),\n    tslib_1.__param(2, (0, inversify_1.inject)(symbols_1.Symbols.IPlayerEntity)),\n    tslib_1.__param(3, (0, inversify_1.inject)(symbols_1.Symbols.IHeroFactory)),\n    tslib_1.__param(4, (0, inversify_1.inject)(symbols_1.Symbols.IPlayerService)),\n    tslib_1.__param(5, (0, inversify_1.inject)(symbols_1.Symbols.IRewardManager)),\n    tslib_1.__param(6, (0, inversify_1.inject)(symbols_1.Symbols.IPathService))\n], HuntGameState);\n\n},{\"../../types\":367,\"../gameContext\":336,\"../symbols\":351,\"../types\":356,\"inversify\":278,\"tslib\":315}],320:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InitGameState = void 0;\nconst tslib_1 = require(\"tslib\");\n/** @module GameContexts */\nconst inversify_1 = require(\"inversify\");\nconst gameContext_1 = require(\"../gameContext\");\nconst types_1 = require(\"../types\");\nconst symbols_1 = require(\"../symbols\");\n/** @public */\nlet InitGameState = class InitGameState extends gameContext_1.GameContextState {\n    constructor(pathService) {\n        super();\n        this.pathService = pathService;\n    }\n    getStateName() {\n        return gameContext_1.GameContextEnum.init;\n    }\n    getAvailableActionNames() {\n        return [\"initGame\", \"changeState\"];\n    }\n    setContextState() { }\n    /**\n     * @public\n     *\n     * @param gameStateDump - game state retrieved from server\n     *\n   \n     */\n    initGame(gameStateDump) {\n        this.pathService.checkPathEnd();\n        this.changeGameContextTo({ contextName: gameContext_1.GameContextEnum.default });\n    }\n    /** @public */\n    changeState(newState, stateParam) {\n        return { error: true, key: types_1.ErrorKey.ValidationError, details: \"can't changeState from int. call initGame first\" };\n    }\n};\nexports.InitGameState = InitGameState;\nexports.InitGameState = InitGameState = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.IPathService))\n], InitGameState);\n\n},{\"../gameContext\":336,\"../symbols\":351,\"../types\":356,\"inversify\":278,\"tslib\":315}],321:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createContainer = void 0;\nconst symbols_1 = require(\"./symbols\");\nconst randomService_1 = require(\"../services/randomService\");\nconst timeService_1 = require(\"./utils/timeService\");\nconst inversify_1 = require(\"inversify\");\nconst rewardsGenerator_1 = require(\"./services/rewardsGenerator\");\nconst Hero_1 = require(\"./entities/Hero\");\nconst heroConfigRepository_1 = require(\"./entities/Hero/heroConfigRepository\");\nconst heroStatsCalculator_1 = require(\"./entities/Hero/heroStatsCalculator\");\nconst battle_1 = require(\"./contexts/battle\");\nconst gameGlobal_1 = require(\"./contexts/gameGlobal\");\nconst default_1 = require(\"./contexts/default\");\nconst init_1 = require(\"./contexts/init\");\nconst hunt_1 = require(\"./contexts/hunt\");\nconst gameContext_1 = require(\"./gameContext\");\nconst playerService_1 = require(\"./services/playerService\");\nconst inventoryService_1 = require(\"./services/inventoryService\");\nconst heroService_1 = require(\"./services/heroService\");\nconst pathService_1 = require(\"./services/pathService\");\nconst battleService_1 = require(\"./services/battleService\");\nconst Player_1 = require(\"./entities/Player\");\nconst Inventory_1 = require(\"./entities/Inventory\");\nconst RewardManager_1 = require(\"./entities/RewardManager\");\nconst Sleep_1 = require(\"./entities/Sleep\");\nconst ConfigManager_1 = require(\"./entities/ConfigManager\");\nconst ResourceManager_1 = require(\"./entities/ResourceManager\");\nconst uuidGenerator_1 = require(\"../server/uuidGenerator\");\nconst featureToggleService_1 = require(\"./utils/featureToggleService\");\nconst sleepService_1 = require(\"./services/sleep/sleepService\");\nconst streakService_1 = require(\"./services/sleep/streak/streakService\");\nconst rawSleepDataTranformer_1 = require(\"./services/sleep/rawSleepDataTranformer\");\nconst sleepDataValidator_1 = require(\"./services/sleep/sleepDataValidator\");\nconst sleepDeltasCalculator_1 = require(\"./services/sleep/sleepDeltasCalculator\");\nconst sleepEventPayloadBuilder_1 = require(\"./services/sleep/sleepEventPayloadBuilder\");\nconst sleepBonusCalculator_1 = require(\"./utils/sleepBonusCalculator\");\nconst configValidator_1 = require(\"../services/config/configValidator\");\nconst narrativeService_1 = require(\"./utils/narrativeService\");\nfunction createContainer() {\n    const container = new inversify_1.Container();\n    container.bind(symbols_1.Symbols.ITimeService).to(timeService_1.TimeService);\n    container.bind(symbols_1.Symbols.IRpgUuidGenerator).to(uuidGenerator_1.UuidGenerator);\n    container.bind(symbols_1.Symbols.IRewardsGenerator).to(rewardsGenerator_1.RewardsGenerator).inSingletonScope();\n    container.bind(symbols_1.Symbols.IFeatureToggleService).to(featureToggleService_1.FeatureToggleService).inSingletonScope();\n    container.bind(symbols_1.Symbols.IRandomService).to(randomService_1.RandomService);\n    container.bind(symbols_1.Symbols.IRNGFactory).to(randomService_1.RNGFactory);\n    container.bind(symbols_1.Symbols.IPlayerService).to(playerService_1.PlayerService);\n    container.bind(symbols_1.Symbols.IHeroService).to(heroService_1.HeroService);\n    container.bind(symbols_1.Symbols.IInventoryService).to(inventoryService_1.InventoryService);\n    container.bind(symbols_1.Symbols.IPathService).to(pathService_1.PathService);\n    container.bind(symbols_1.Symbols.IBattleService).to(battleService_1.BattleService);\n    container.bind(symbols_1.Symbols.IHeroConfigRepository).to(heroConfigRepository_1.HeroConfigRepository).inSingletonScope();\n    container.bind(symbols_1.Symbols.IHeroStatsCalculator).to(heroStatsCalculator_1.HeroStatsCalculator);\n    container.bind(symbols_1.Symbols.IHeroFactory).to(Hero_1.HeroFactory).inSingletonScope();\n    container.bind(symbols_1.Symbols.IPlayerEntity).to(Player_1.PlayerEntity).inSingletonScope();\n    container.bind(symbols_1.Symbols.IInventoryEntity).to(Inventory_1.InventoryEntity).inSingletonScope();\n    container.bind(symbols_1.Symbols.IRewardManager).to(RewardManager_1.RewardManager).inSingletonScope();\n    container.bind(symbols_1.Symbols.ISleepEntity).to(Sleep_1.SleepEntity).inSingletonScope();\n    container.bind(symbols_1.Symbols.IConfigManager).to(ConfigManager_1.ConfigManager).inSingletonScope();\n    container.bind(symbols_1.Symbols.IResourceManager).to(ResourceManager_1.ResourceManager).inSingletonScope();\n    container.bind(symbols_1.Symbols.ISleepService).to(sleepService_1.SleepService);\n    container.bind(symbols_1.Symbols.IStreakService).to(streakService_1.StreakService);\n    container.bind(symbols_1.Symbols.IRawSleepDataTransformer).to(rawSleepDataTranformer_1.RawSleepDataTransformer);\n    container.bind(symbols_1.Symbols.ISleepDataValidator).to(sleepDataValidator_1.SleepDataValidator);\n    container.bind(symbols_1.Symbols.ISleepDeltasCalculator).to(sleepDeltasCalculator_1.SleepDeltasCalculator);\n    container.bind(symbols_1.Symbols.ISleepEventPayloadBuilder).to(sleepEventPayloadBuilder_1.SleepEventPayloadBuilder);\n    container.bind(symbols_1.Symbols.ISleepBonusCalculator).to(sleepBonusCalculator_1.SleepBonusCalculator);\n    container.bind(symbols_1.Symbols.INarrativeService).to(narrativeService_1.NarrativeService);\n    container.bind(symbols_1.Symbols.IGameContext).to(gameContext_1.GameContext);\n    container.bind(symbols_1.Symbols.IGameContextGlobalState).to(gameGlobal_1.GameGlobalState);\n    container.bind(symbols_1.Symbols.IGameContextState).to(init_1.InitGameState);\n    container.bind(symbols_1.Symbols.IGameContextState).to(default_1.DefaultGameState);\n    container.bind(symbols_1.Symbols.IGameContextState).to(battle_1.BattleGameState).inSingletonScope();\n    container.bind(symbols_1.Symbols.IGameContextState).to(hunt_1.HuntGameState).inSingletonScope();\n    container.bind(symbols_1.Symbols.IGameContextInitialState).toConstantValue(gameContext_1.GameContextEnum.init);\n    container.bind(symbols_1.Symbols.IConfigValidator).to(configValidator_1.ConfigValidator).inSingletonScope();\n    return container;\n}\nexports.createContainer = createContainer;\n\n},{\"../server/uuidGenerator\":363,\"../services/config/configValidator\":364,\"../services/randomService\":365,\"./contexts/battle\":316,\"./contexts/default\":317,\"./contexts/gameGlobal\":318,\"./contexts/hunt\":319,\"./contexts/init\":320,\"./entities/ConfigManager\":322,\"./entities/Hero\":327,\"./entities/Hero/heroConfigRepository\":324,\"./entities/Hero/heroStatsCalculator\":326,\"./entities/Inventory\":331,\"./entities/Player\":332,\"./entities/ResourceManager\":333,\"./entities/RewardManager\":334,\"./entities/Sleep\":335,\"./gameContext\":336,\"./services/battleService\":338,\"./services/heroService\":339,\"./services/inventoryService\":340,\"./services/pathService\":341,\"./services/playerService\":342,\"./services/rewardsGenerator\":343,\"./services/sleep/rawSleepDataTranformer\":344,\"./services/sleep/sleepDataValidator\":345,\"./services/sleep/sleepDeltasCalculator\":346,\"./services/sleep/sleepEventPayloadBuilder\":347,\"./services/sleep/sleepService\":348,\"./services/sleep/streak/streakService\":349,\"./symbols\":351,\"./utils/featureToggleService\":359,\"./utils/narrativeService\":360,\"./utils/sleepBonusCalculator\":361,\"./utils/timeService\":362,\"inversify\":278}],322:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConfigManager = void 0;\nconst tslib_1 = require(\"tslib\");\nconst inversify_1 = require(\"inversify\");\nconst types_1 = require(\"../../types\");\nconst symbols_1 = require(\"../symbols\");\nconst types_2 = require(\"../types\");\nfunction getKeyByValue(object, value) {\n    return Object.keys(object).find((key) => object[key] === value);\n}\nlet ConfigManager = class ConfigManager {\n    constructor(gameState, configValidator) {\n        this.gameState = gameState;\n        this.configValidator = configValidator;\n        this.configsNeeded = new Set();\n        for (const key of Object.keys(gameState._configIds)) {\n            if (gameState._configs[key] == null) {\n                this.configsNeeded.add(key);\n            }\n        }\n        if (this.gameState._configs.base != null) {\n            this.constants = this.parseConstantsConfig(this.gameState._configs.base.constants);\n        }\n    }\n    getConfig(key) {\n        const config = this.gameState._configs[key];\n        if (config == null) {\n            if (!this.configsNeeded.has(key)) {\n                this.configsNeeded.add(key);\n            }\n            throw new types_2.ConfigNeededError(\"download configs first\");\n        }\n        return config;\n    }\n    addConfigs(newConfigsRaw) {\n        const newConfigs = (0, types_1.ConfigRecordValidator)(Object.assign({}, newConfigsRaw));\n        for (const [key, value] of Object.entries(newConfigs)) {\n            const configKey = getKeyByValue(this.gameState._configIds, key);\n            if (configKey == null || !this.configsNeeded.has(configKey)) {\n                throw new Error(`config not needed - ${key}`);\n            }\n            if (configKey === \"base\") {\n                this.gameState._configs.base = this.configValidator.checkBaseConfig(value);\n                this.constants = this.parseConstantsConfig(this.gameState._configs.base.constants);\n            }\n            else if (configKey === \"battles\") {\n                this.gameState._configs.battles = this.configValidator.checkBattleConfig(value);\n            }\n            else if (configKey === \"currentPath\") {\n                this.gameState._configs.currentPath = this.configValidator.checkPathConfig(value);\n            }\n            else if (configKey === \"nextPath\") {\n                this.gameState._configs.nextPath = this.configValidator.checkPathConfig(value);\n            }\n            else if (configKey === \"dialogues\") {\n                this.gameState._configs.dialogues = this.configValidator.checkDialoguesConfig(value);\n            }\n            else if (configKey === \"hunt\") {\n                this.gameState._configs.hunt = this.configValidator.checkHuntConfig(value);\n            }\n            else if (configKey === \"rewards\") {\n                this.gameState._configs.rewards = this.configValidator.checkRewardsConfig(value);\n            }\n            this.configsNeeded.delete(configKey);\n        }\n    }\n    getBattle(battleId) {\n        const config = this.getConfig(\"battles\");\n        return config[battleId];\n    }\n    getDialogue(dialogueId) {\n        const config = this.getConfig(\"dialogues\");\n        return config.find((el) => el.dialogueId === dialogueId);\n    }\n    getHuntMaxStage() {\n        const config = this.getConfig(\"hunt\");\n        return config.length - 1;\n    }\n    getHuntStageConfig(stageId) {\n        if (stageId < 0 || stageId > this.getHuntMaxStage()) {\n            throw new Error(`wrong hunt stage id - ${stageId}`);\n        }\n        const config = this.getConfig(\"hunt\");\n        return config[stageId];\n    }\n    getRewardPack(rewardId) {\n        const config = this.getConfig(\"rewards\");\n        return config[rewardId];\n    }\n    isOnThePath(idx) {\n        return this.gameState._configIds.currentPath === `p${idx + 1}m`;\n    }\n    movePath(to) {\n        var _a;\n        if (this.gameState._configIds.nextPath === `p${to + 1}m`) {\n            if (((_a = this.gameState._configs.nextPath) === null || _a === void 0 ? void 0 : _a.length) === 0) {\n                return false;\n            }\n            else {\n                this.setConfigId(\"currentPath\", `p${to + 1}m`, this.gameState._configs.nextPath);\n            }\n        }\n        else {\n            this.setConfigId(\"currentPath\", `p${to + 1}m`);\n        }\n        this.setConfigId(\"nextPath\", `p${to + 2}m`);\n        return true;\n    }\n    getConfigId(key) {\n        return this.gameState._configIds[key];\n    }\n    setConfigId(key, id, config) {\n        this.gameState._configIds[key] = id;\n        this.gameState._configs[key] = config !== null && config !== void 0 ? config : undefined;\n        if (!this.configsNeeded.has(key)) {\n            this.configsNeeded.add(key);\n        }\n    }\n    getConfigsNeeded() {\n        const configIds = [];\n        for (const el of [...this.configsNeeded]) {\n            configIds.push(this.gameState._configIds[el]);\n        }\n        return { configIds };\n    }\n    getConstants() {\n        if (this.constants == null) {\n            throw new types_2.ConfigNeededError(\"download configs first\");\n        }\n        return this.constants;\n    }\n    parseConstantsConfig(constants) {\n        const result = {};\n        for (const item of constants) {\n            if (types_1.ConstantsStrings.some((v) => v === item.key)) {\n                result[item.key] = item.value;\n            }\n            else if (types_1.ConstantsNumber.some((v) => v === item.key)) {\n                result[item.key] = item.value;\n            }\n            else {\n                throw new Error(`unknown constant ${item.key}`);\n            }\n        }\n        for (const key of Object.values(types_1.ConstantKey)) {\n            if (result[key] == null)\n                throw new Error(`constant ${key} is not set`);\n        }\n        return result;\n    }\n};\nexports.ConfigManager = ConfigManager;\nexports.ConfigManager = ConfigManager = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.InitialGameState)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.IConfigValidator))\n], ConfigManager);\n\n},{\"../../types\":367,\"../symbols\":351,\"../types\":356,\"inversify\":278,\"tslib\":315}],323:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Hero = void 0;\nclass Hero {\n    constructor(statsCalculator, heroConfig, data, ultimateConfig) {\n        this.statsCalculator = statsCalculator;\n        this.heroConfig = heroConfig;\n        this.data = data;\n        this.ultimateConfig = ultimateConfig;\n    }\n    get heroType() {\n        return this.data.heroType;\n    }\n    get config() {\n        return this.heroConfig;\n    }\n    get stars() {\n        return this.data.stars;\n    }\n    get level() {\n        return this.data.level;\n    }\n    get heroRarity() {\n        return this.heroConfig.heroRarity;\n    }\n    get name() {\n        return this.heroConfig.name;\n    }\n    get moveSpeed() {\n        return this.heroConfig.moveSpeed;\n    }\n    get attackRange() {\n        return this.heroConfig.attackRange;\n    }\n    get attackDelay() {\n        return this.heroConfig.attackDelay;\n    }\n    get attackType() {\n        return this.heroConfig.attackType;\n    }\n    get hp() {\n        var _a;\n        (_a = this._hp) !== null && _a !== void 0 ? _a : (this._hp = this.statsCalculator.getHp(this));\n        return this._hp;\n    }\n    get attack() {\n        var _a;\n        (_a = this._attack) !== null && _a !== void 0 ? _a : (this._attack = this.statsCalculator.getAttack(this));\n        return this._attack;\n    }\n    get physicDefence() {\n        var _a;\n        (_a = this._physicDefence) !== null && _a !== void 0 ? _a : (this._physicDefence = this.statsCalculator.getPhysicDefence(this));\n        return this._physicDefence;\n    }\n    get magicDefence() {\n        var _a;\n        (_a = this._magicDefence) !== null && _a !== void 0 ? _a : (this._magicDefence = this.statsCalculator.getMagicDefence(this));\n        return this._magicDefence;\n    }\n    get mastery() {\n        var _a;\n        (_a = this._mastery) !== null && _a !== void 0 ? _a : (this._mastery = this.statsCalculator.getMastery(this));\n        return this._mastery;\n    }\n    get heroClass() {\n        return this.heroConfig.heroClass;\n    }\n    get maxStars() {\n        return this.statsCalculator.getMaxStars(this);\n    }\n    get ultimate() {\n        return this.statsCalculator.getUltimate(this, this.ultimateConfig);\n    }\n    get element() {\n        return this.heroConfig.element;\n    }\n    get power() {\n        var _a;\n        (_a = this._power) !== null && _a !== void 0 ? _a : (this._power = this.statsCalculator.getPower(this));\n        return this._power;\n    }\n    get gachable() {\n        return this.config.gachable;\n    }\n    toDto() {\n        return {\n            heroType: this.heroType,\n            heroClass: this.heroClass,\n            level: this.level,\n            stars: this.stars,\n            name: this.name,\n            hp: this.hp,\n            attack: this.attack,\n            physicDefence: this.physicDefence,\n            magicDefence: this.magicDefence,\n            mastery: this.mastery,\n            heroRarity: this.config.heroRarity,\n            attackDelay: this.attackDelay,\n            attackRange: this.attackRange,\n            attackType: this.attackType,\n            moveSpeed: this.moveSpeed,\n            maxStars: this.maxStars,\n            ultimate: this.ultimate,\n            element: this.element,\n            power: this.power,\n            gachable: this.gachable,\n        };\n    }\n    levelUp() {\n        this.data.level += 1;\n        this.dropCache();\n    }\n    starUp() {\n        this.data.stars += 1;\n        this.dropCache();\n    }\n    dropCache() {\n        this._hp = undefined;\n        this._attack = undefined;\n        this._magicDefence = undefined;\n        this._physicDefence = undefined;\n        this._mastery = undefined;\n        this._power = undefined;\n    }\n}\nexports.Hero = Hero;\n\n},{}],324:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HeroConfigRepository = void 0;\nconst tslib_1 = require(\"tslib\");\nconst inversify_1 = require(\"inversify\");\nconst symbols_1 = require(\"../../symbols\");\nlet HeroConfigRepository = class HeroConfigRepository {\n    constructor(configManager) {\n        this.configManager = configManager;\n        const { heroesConfig } = this.configManager.getConfig(\"base\");\n        this.heroConfigMap = new Map(heroesConfig.heroes.map((cfg) => [cfg.heroType, cfg]));\n        this.ultimateConfigMap = new Map(heroesConfig.ultimateAbilities.map((u) => [u.ultimateType, u]));\n    }\n    getHeroConfig(configId) {\n        const cfg = this.heroConfigMap.get(configId);\n        if (cfg == null) {\n            throw new Error(`Invalid configId: ${configId}`);\n        }\n        return cfg;\n    }\n    getUltimate(ultimateType) {\n        const ult = this.ultimateConfigMap.get(ultimateType);\n        if (ult == null) {\n            throw new Error(`Invalid ultimateType: ${ultimateType}`);\n        }\n        return ult;\n    }\n};\nexports.HeroConfigRepository = HeroConfigRepository;\nexports.HeroConfigRepository = HeroConfigRepository = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.IConfigManager))\n], HeroConfigRepository);\n\n},{\"../../symbols\":351,\"inversify\":278,\"tslib\":315}],325:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HeroFactory = void 0;\nconst tslib_1 = require(\"tslib\");\n/** @module definitions */\nconst inversify_1 = require(\"inversify\");\nconst symbols_1 = require(\"../../symbols\");\nconst Hero_1 = require(\"./Hero\");\nlet HeroFactory = class HeroFactory {\n    constructor(heroConfigRepository, heroStatsCalculator) {\n        this.heroConfigRepository = heroConfigRepository;\n        this.heroStatsCalculator = heroStatsCalculator;\n    }\n    createForDeck(heroData) {\n        const heroConfig = this.heroConfigRepository.getHeroConfig(heroData.heroType);\n        if (heroConfig.ultimate != null) {\n            const ultimate = this.heroConfigRepository.getUltimate(heroConfig.ultimate);\n            return new Hero_1.Hero(this.heroStatsCalculator, heroConfig, heroData, ultimate);\n        }\n        return new Hero_1.Hero(this.heroStatsCalculator, heroConfig, heroData);\n    }\n};\nexports.HeroFactory = HeroFactory;\nexports.HeroFactory = HeroFactory = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.IHeroConfigRepository)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.IHeroStatsCalculator))\n], HeroFactory);\n\n},{\"../../symbols\":351,\"./Hero\":323,\"inversify\":278,\"tslib\":315}],326:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HeroStatsCalculator = void 0;\nconst tslib_1 = require(\"tslib\");\nconst inversify_1 = require(\"inversify\");\nconst symbols_1 = require(\"../../symbols\");\nconst expr_eval_1 = require(\"expr-eval\");\nconst parser = new expr_eval_1.Parser();\nlet HeroStatsCalculator = class HeroStatsCalculator {\n    constructor(configManager) {\n        this.configManager = configManager;\n    }\n    getMaxStars(hero) {\n        return this.configManager.getConstants().maxTier;\n    }\n    getHp(hero) {\n        return parser.evaluate(hero.config.hp, { level: hero.level, mastery: hero.mastery });\n    }\n    getPhysicDefence(hero) {\n        return parser.evaluate(hero.config.physicDefence, { level: hero.level, mastery: hero.mastery });\n    }\n    getMagicDefence(hero) {\n        return parser.evaluate(hero.config.magicDefence, { level: hero.level, mastery: hero.mastery });\n    }\n    getAttack(hero) {\n        return parser.evaluate(hero.config.attack, { level: hero.level, mastery: hero.mastery });\n    }\n    getPower(hero) {\n        return parser.evaluate(hero.config.power, { level: hero.level, mastery: hero.mastery });\n    }\n    getMastery(hero) {\n        return parser.evaluate(hero.config.mastery, { stars: hero.stars });\n    }\n    getUltimate(hero, ultimateConfig) {\n        if (ultimateConfig == null) {\n            return;\n        }\n        return {\n            ultimateType: ultimateConfig.ultimateType,\n            a: parser.evaluate(ultimateConfig.a, { level: hero.level, mastery: hero.mastery }),\n            b: parser.evaluate(ultimateConfig.b, { level: hero.level, mastery: hero.mastery }),\n            c: parser.evaluate(ultimateConfig.c, { level: hero.level, mastery: hero.mastery }),\n            d: parser.evaluate(ultimateConfig.d, { level: hero.level, mastery: hero.mastery }),\n            e: parser.evaluate(ultimateConfig.e, { level: hero.level, mastery: hero.mastery }),\n            f: parser.evaluate(ultimateConfig.f, { level: hero.level, mastery: hero.mastery }),\n            g: parser.evaluate(ultimateConfig.g, { level: hero.level, mastery: hero.mastery }),\n            h: parser.evaluate(ultimateConfig.h, { level: hero.level, mastery: hero.mastery }),\n            i: parser.evaluate(ultimateConfig.i, { level: hero.level, mastery: hero.mastery }),\n            j: parser.evaluate(ultimateConfig.j, { level: hero.level, mastery: hero.mastery }),\n        };\n    }\n};\nexports.HeroStatsCalculator = HeroStatsCalculator;\nexports.HeroStatsCalculator = HeroStatsCalculator = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.IConfigManager))\n], HeroStatsCalculator);\n\n},{\"../../symbols\":351,\"expr-eval\":254,\"inversify\":278,\"tslib\":315}],327:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./heroFactory\"), exports);\ntslib_1.__exportStar(require(\"./Hero\"), exports);\n\n},{\"./Hero\":323,\"./heroFactory\":325,\"tslib\":315}],328:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InventoryEntityBase = void 0;\nconst tslib_1 = require(\"tslib\");\nconst inversify_1 = require(\"inversify\");\nlet InventoryEntityBase = class InventoryEntityBase {\n    constructor(gameState, uuidGenerator) {\n        this.gameState = gameState;\n        this.uuidGenerator = uuidGenerator;\n    }\n};\nexports.InventoryEntityBase = InventoryEntityBase;\nexports.InventoryEntityBase = InventoryEntityBase = tslib_1.__decorate([\n    (0, inversify_1.injectable)()\n], InventoryEntityBase);\n\n},{\"inversify\":278,\"tslib\":315}],329:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InventoryEntityResources = void 0;\nconst tslib_1 = require(\"tslib\");\nconst types_1 = require(\"../../../types\");\nconst InventoryBase_1 = require(\"./InventoryBase\");\nconst inversify_1 = require(\"inversify\");\nlet InventoryEntityResources = class InventoryEntityResources extends InventoryBase_1.InventoryEntityBase {\n    isResource(item) {\n        return types_1.InventoryResourceItemGuard.guard(item);\n    }\n    getResource(resourceType) {\n        return this._getResource(resourceType);\n    }\n    hasResource(resourceType, amount) {\n        var _a, _b;\n        const inventoryResourceAmount = (_b = (_a = this._getResource(resourceType)) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : 0;\n        return inventoryResourceAmount >= amount;\n    }\n    spendResource(resourceType, amount) {\n        if (amount === 0)\n            return;\n        const inventoryResource = this._getResource(resourceType);\n        if (inventoryResource == null || inventoryResource.amount < amount) {\n            throw new Error(`not enought resource (${resourceType})`);\n        }\n        this.remove(inventoryResource.id, amount);\n    }\n    addResource(payload, amount) {\n        if (amount === 0)\n            return;\n        this.add({\n            itemType: types_1.InventoryItemType.resource,\n            payload,\n        }, amount);\n    }\n    getHeroCard(heroType) {\n        return this.sorted[types_1.InventoryItemType.resource].find((el) => el.itemType === types_1.InventoryItemType.resource &&\n            el.payload.resourceType === types_1.ResourceType.heroCard &&\n            el.payload.heroType === heroType);\n    }\n    hasHeroCard(heroType, amount) {\n        var _a, _b;\n        return ((_b = (_a = this.getHeroCard(heroType)) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : 0) >= amount;\n    }\n    spendHeroCard(heroType, amount) {\n        if (amount === 0)\n            return;\n        const heroCard = this.getHeroCard(heroType);\n        if (heroCard == null || heroCard.amount < amount) {\n            throw new Error(`not enought resource (${types_1.ResourceType.heroCard})`);\n        }\n        this.remove(heroCard.id, amount);\n    }\n    getHeroNut(heroRarity) {\n        return this.sorted[types_1.InventoryItemType.resource].find((el) => el.itemType === types_1.InventoryItemType.resource &&\n            el.payload.resourceType === types_1.ResourceType.heroStarDust &&\n            el.payload.heroRarity === heroRarity);\n    }\n    hasHeroNut(heroRarity, amount) {\n        var _a, _b;\n        return ((_b = (_a = this.getHeroNut(heroRarity)) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : 0) >= amount;\n    }\n    spendHeroNut(heroRarity, amount) {\n        if (amount === 0)\n            return;\n        const heroNut = this.getHeroNut(heroRarity);\n        if (heroNut == null || heroNut.amount < amount) {\n            throw new Error(`not enought resource (${types_1.ResourceType.heroStarDust})`);\n        }\n        this.remove(heroNut.id, amount);\n    }\n    _getResource(resourceType) {\n        return this.sorted[types_1.InventoryItemType.resource].find((el) => el.itemType === types_1.InventoryItemType.resource && el.payload.resourceType === resourceType);\n    }\n    hydrateResource(slot) {\n        return Object.assign({}, slot);\n    }\n    dehydrateResource(slot) {\n        return Object.assign({}, slot);\n    }\n};\nexports.InventoryEntityResources = InventoryEntityResources;\nexports.InventoryEntityResources = InventoryEntityResources = tslib_1.__decorate([\n    (0, inversify_1.injectable)()\n], InventoryEntityResources);\n\n},{\"../../../types\":367,\"./InventoryBase\":328,\"inversify\":278,\"tslib\":315}],330:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultCompareFunc = void 0;\nconst types_1 = require(\"../../../types\");\nexports.DefaultCompareFunc = {\n    [types_1.InventoryItemType.resource]: ((a, b) => {\n        if (a.resourceType === b.resourceType) {\n            if (a.resourceType === types_1.ResourceType.heroCard && b.resourceType === types_1.ResourceType.heroCard) {\n                return a.heroType === b.heroType ? 0 : a.heroType < b.heroType ? 1 : -1;\n            }\n            else if (a.resourceType === types_1.ResourceType.heroStarDust && b.resourceType === types_1.ResourceType.heroStarDust) {\n                return a.heroRarity === b.heroRarity ? 0 : a.heroRarity < b.heroRarity ? 1 : -1;\n            }\n            else {\n                return 0;\n            }\n        }\n        else {\n            return a.resourceType < b.resourceType ? 1 : -1;\n        }\n    }),\n};\n\n},{\"../../../types\":367}],331:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InventoryEntity = void 0;\nconst tslib_1 = require(\"tslib\");\nconst ts_mixer_1 = require(\"ts-mixer\");\nconst inversify_1 = require(\"inversify\");\nconst symbols_1 = require(\"../../symbols\");\nconst constants_1 = require(\"./constants\");\nconst types_1 = require(\"../../../types\");\nconst InventoryResources_1 = require(\"./InventoryResources\");\nconst MixedInventoryEntity = (0, ts_mixer_1.Mixin)(InventoryResources_1.InventoryEntityResources);\n(0, inversify_1.decorate)((0, inversify_1.injectable)(), MixedInventoryEntity);\nlet InventoryEntity = class InventoryEntity extends MixedInventoryEntity {\n    constructor(gameState, uuidGenerator) {\n        super(gameState, uuidGenerator);\n        this.gameState = gameState;\n        this.uuidGenerator = uuidGenerator;\n        this.sorted = {\n            [types_1.InventoryItemType.resource]: [],\n        };\n        this.keysRegister = new Map();\n        const inventory = this.hydrate();\n        // eslint-disable-next-line guard-for-in\n        for (const itemType in this.sorted) {\n            this.sorted[itemType] = this.getSortedItems(itemType, inventory);\n            this.updateKeysRegistry(itemType);\n        }\n    }\n    dump() {\n        return this.dehydrate(this.getAllByType(\"all\"));\n    }\n    getAllByType(itemType) {\n        switch (itemType) {\n            case \"all\":\n                return Object.values(this.sorted).flat();\n            default:\n                return [...this.sorted[itemType]];\n        }\n    }\n    getOneById(id) {\n        const reg = this.keysRegister.get(id);\n        if (reg == null) {\n            throw new Error(\"item not found\");\n        }\n        return this.sorted[reg.itemType][reg.idx];\n    }\n    add(item, amount) {\n        if (amount === 0) {\n            throw new Error(\"attempt to add 0 items\");\n        }\n        const compareFunc = constants_1.DefaultCompareFunc[item.itemType];\n        const foundIdx = this.sorted[item.itemType].findIndex((existingItem) => compareFunc(existingItem.payload, item.payload) === 0);\n        if (foundIdx >= 0) {\n            return this.updateAmountToExistingItem(item.itemType, foundIdx, amount);\n        }\n        else {\n            return this.addNewItem(Object.assign(Object.assign({}, item), { amount }));\n        }\n    }\n    remove(id, amount) {\n        const reg = this.keysRegister.get(id);\n        if (reg == null) {\n            throw new Error(\"item not found on remove\"); // TODO discuss contract - maybe null is better\n        }\n        const item = this.sorted[reg.itemType][reg.idx];\n        item.amount -= amount;\n        if (item.amount === 0) {\n            this.sorted[reg.itemType].splice(reg.idx, 1);\n            this.keysRegister.delete(item.id);\n            this.updateKeysRegistry(reg.itemType);\n        }\n    }\n    update(id, payload) {\n        const reg = this.keysRegister.get(id);\n        if (reg == null) {\n            throw new Error(\"item not found\");\n        }\n        const item = this.getOneById(id);\n        item.payload = payload;\n        let isValid = false;\n        switch (item.itemType) {\n            case types_1.InventoryItemType.resource:\n                isValid = this.isResource(item);\n                break;\n        }\n        if (!isValid) {\n            throw new Error(\"invalid payload type\");\n        }\n        if (this.sorted[reg.itemType][reg.idx].amount === 1) {\n            this.sorted[reg.itemType][reg.idx].payload = payload;\n            return id;\n        }\n        // if more than 1 item - split them and level up only 1\n        this.sorted[reg.itemType][reg.idx].amount -= 1;\n        return this.add(item, 1);\n    }\n    genNewId() {\n        let id;\n        do {\n            id = this.uuidGenerator.generateUuid();\n        } while (this.keysRegister.has(id));\n        return id;\n    }\n    getSortedItems(itemType, inventory) {\n        const typeItems = inventory.filter((item) => item.itemType === itemType);\n        const compareFunc = constants_1.DefaultCompareFunc[itemType];\n        return typeItems.sort((a, b) => compareFunc(a.payload, b.payload));\n    }\n    updateKeysRegistry(itemType) {\n        this.sorted[itemType].forEach((el, idx) => {\n            this.keysRegister.set(el.id, { itemType, idx });\n        });\n    }\n    updateAmountToExistingItem(itemType, idx, amount) {\n        // TODO if new amount === 0\n        this.sorted[itemType][idx].amount += amount;\n        return this.sorted[itemType][idx].id;\n    }\n    addNewItem(item) {\n        const compareFunc = constants_1.DefaultCompareFunc[item.itemType];\n        const id = this.genNewId();\n        const insertIdx = this.sorted[item.itemType].findIndex((existingItem) => compareFunc(existingItem.payload, item.payload) > 0);\n        if (insertIdx === -1) {\n            this.sorted[item.itemType].push(Object.assign(Object.assign({}, item), { id }));\n        }\n        else {\n            this.sorted[item.itemType].splice(insertIdx, 0, Object.assign(Object.assign({}, item), { id }));\n        }\n        this.updateKeysRegistry(item.itemType);\n        return id;\n    }\n    hydrate() {\n        const hydrated = [];\n        for (const slot of this.gameState.player.inventory) {\n            switch (slot.itemType) {\n                case types_1.InventoryItemType.resource:\n                    hydrated.push(this.hydrateResource(slot));\n                    break;\n            }\n        }\n        return hydrated;\n    }\n    dehydrate(items) {\n        const dehydrated = [];\n        for (const slot of items) {\n            switch (slot.itemType) {\n                case types_1.InventoryItemType.resource:\n                    dehydrated.push(this.dehydrateResource(slot));\n                    break;\n            }\n        }\n        return dehydrated;\n    }\n};\nexports.InventoryEntity = InventoryEntity;\nexports.InventoryEntity = InventoryEntity = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.InitialGameState)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.IRpgUuidGenerator))\n], InventoryEntity);\n\n},{\"../../../types\":367,\"../../symbols\":351,\"./InventoryResources\":329,\"./constants\":330,\"inversify\":278,\"ts-mixer\":314,\"tslib\":315}],332:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PlayerEntity = void 0;\nconst tslib_1 = require(\"tslib\");\nconst symbols_1 = require(\"../symbols\");\nconst inversify_1 = require(\"inversify\");\nconst types_1 = require(\"../../types\");\nconst expr_eval_1 = require(\"expr-eval\");\nconst parser = new expr_eval_1.Parser();\nlet PlayerEntity = class PlayerEntity {\n    constructor(timeService, gameState, heroFactory, configManager) {\n        this.timeService = timeService;\n        this.gameState = gameState;\n        this.heroFactory = heroFactory;\n        this.configManager = configManager;\n    }\n    updateHeroesList() {\n        var _a;\n        (_a = this._heroesList) !== null && _a !== void 0 ? _a : (this._heroesList = this.gameState.player.heroes.map((hero) => this.heroFactory.createForDeck(hero)));\n    }\n    getUserHeroes() {\n        this.updateHeroesList();\n        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n        return this._heroesList;\n    }\n    getUserHero(heroType) {\n        var _a;\n        this.updateHeroesList();\n        const hero = (_a = this._heroesList) === null || _a === void 0 ? void 0 : _a.find((h) => h.heroType === heroType);\n        if (hero == null) {\n            throw new Error(\"hero not found\");\n        }\n        return hero;\n    }\n    hasHero(heroType) {\n        const heroData = this.gameState.player.heroes.find((h) => h.heroType === heroType);\n        return heroData != null;\n    }\n    addUserHero(heroType) {\n        var _a;\n        if (this.hasHero(heroType)) {\n            throw new Error(\"attempt to add hero, but already exists\");\n        }\n        const data = {\n            heroType,\n            level: 1,\n            stars: 1,\n        };\n        const heroEntity = this.heroFactory.createForDeck(data);\n        (_a = this._heroesList) === null || _a === void 0 ? void 0 : _a.push(heroEntity);\n        this.gameState.player.heroes.push(data);\n    }\n    getHeroesLowestLevel() {\n        return Math.min(...this.gameState.player.heroes.map((hero) => hero.level));\n    }\n    getExperience() {\n        return this.gameState.player.xp;\n    }\n    addExperience(amount) {\n        if (amount === 0)\n            return;\n        this.gameState.player.xp += amount;\n    }\n    getLevel() {\n        const xp = this.getExperience();\n        const { xpPerLevel } = this.getConfig();\n        for (let i = 0; i < xpPerLevel.length; i++) {\n            if (xp < xpPerLevel[i]) {\n                return {\n                    level: i,\n                    maxLevel: xpPerLevel.length,\n                };\n            }\n        }\n        return {\n            level: xpPerLevel.length,\n            maxLevel: xpPerLevel.length,\n        };\n    }\n    getGold() {\n        return this.gameState.player.gold;\n    }\n    spendGold(amount) {\n        if (amount < 0) {\n            throw new Error(\"attempt to spend less than 0 gold\");\n        }\n        if (amount > this.getGold()) {\n            throw new Error(\"Not enough gold\");\n        }\n        this.gameState.player.gold -= amount;\n    }\n    addGold(amount) {\n        if (amount === 0)\n            return;\n        if (amount < 0) {\n            throw new Error(\"attempt to add less than 0 gold\");\n        }\n        this.gameState.player.gold += amount;\n    }\n    hasGold(amount) {\n        return this.gameState.player.gold >= amount;\n    }\n    getGems() {\n        return this.gameState.player.gems;\n    }\n    spendGems(amount) {\n        if (amount < 0) {\n            throw new Error(\"attempt to spend less than 0 gems\");\n        }\n        if (amount > this.getGems()) {\n            throw new Error(\"Not enough gems\");\n        }\n        this.gameState.player.gems -= amount;\n    }\n    addGems(amount) {\n        if (amount === 0)\n            return;\n        if (amount < 0) {\n            throw new Error(\"attempt to add less than 0 gems\");\n        }\n        this.gameState.player.gems += amount;\n    }\n    hasGems(amount) {\n        return this.gameState.player.gems >= amount;\n    }\n    getVSleep() {\n        return this.gameState.player.vSleep;\n    }\n    spendVSleep(amount) {\n        if (amount < 0) {\n            throw new Error(\"attempt to spend less than 0 vSleep\");\n        }\n        if (amount > this.getVSleep()) {\n            throw new Error(\"Not enough vSleep\");\n        }\n        this.gameState.player.vSleep -= amount;\n    }\n    addVSleep(amount) {\n        if (amount === 0)\n            return;\n        if (amount < 0) {\n            throw new Error(\"attempt to add less than 0 vSleep\");\n        }\n        this.gameState.player.vSleep += amount;\n    }\n    hasVSleep(amount) {\n        return this.gameState.player.vSleep >= amount;\n    }\n    getPathInfo() {\n        return {\n            pathIdx: this.gameState.player.path.pathIdx,\n            pathStep: this.gameState.player.path.pathStep,\n            pathStage: this.gameState.player.path.pathStage,\n            eventFinished: this.gameState.player.path.eventFinished,\n        };\n    }\n    setPathInfo(opts) {\n        var _a, _b, _c, _d;\n        this.gameState.player.path = Object.assign(Object.assign({}, this.gameState.player.path), { pathIdx: (_a = opts.pathIdx) !== null && _a !== void 0 ? _a : this.gameState.player.path.pathIdx, pathStep: (_b = opts.pathStep) !== null && _b !== void 0 ? _b : this.gameState.player.path.pathStep, pathStage: (_c = opts.pathStage) !== null && _c !== void 0 ? _c : this.gameState.player.path.pathStage, eventFinished: (_d = opts.eventFinished) !== null && _d !== void 0 ? _d : this.gameState.player.path.eventFinished });\n    }\n    addHiddenResource(resourceType, amount = 1) {\n        var _a;\n        if (amount === 0)\n            return;\n        if (amount < 1) {\n            throw new Error(`attempt to add less than 1 ${resourceType}`);\n        }\n        this.gameState.player.hidden[resourceType] = amount + ((_a = this.gameState.player.hidden[resourceType]) !== null && _a !== void 0 ? _a : 0);\n    }\n    getHiddenResource(resourceType) {\n        var _a;\n        return (_a = this.gameState.player.hidden[resourceType]) !== null && _a !== void 0 ? _a : 0;\n    }\n    spendHiddenResource(resourceType, amount = 1) {\n        var _a;\n        if (amount < 1) {\n            throw new Error(`attempt to spend less than 1 ${resourceType}`);\n        }\n        if (amount > this.getHiddenResource(resourceType)) {\n            throw new Error(`Not enough ${resourceType}`);\n        }\n        this.gameState.player.hidden[resourceType] = ((_a = this.gameState.player.hidden[resourceType]) !== null && _a !== void 0 ? _a : 0) - amount;\n    }\n    hasHiddenResource(resourceType, amount = 1) {\n        return this.gameState.player.hidden[resourceType] >= amount;\n    }\n    setHiddenResource(resourceType, amount) {\n        this.gameState.player.hidden[resourceType] = amount;\n    }\n    getIdlerInfo() {\n        const hunt = this.getHuntInfo();\n        const now = this.timeService.now();\n        const lastClaim = this.gameState.player.meta.idlerLastClaim;\n        return {\n            hunt,\n            rewards: this.calcIdlerRewardsProduced(hunt.huntLevel, lastClaim, now).map((el) => (Object.assign(Object.assign({}, el), { amount: Math.round(el.amount) }))),\n            production: this.idlerCalcProduction(hunt.huntLevel),\n        };\n    }\n    getHuntInfo() {\n        const huntLevel = this.getHuntLevel();\n        return {\n            stage: this.gameState.player.hunt.stage,\n            huntLevel,\n            huntNextLevelStage: this.getHuntLevelNextStage(huntLevel),\n        };\n    }\n    huntChangeStage(stage) {\n        const time = this.timeService.now();\n        this.gameState.player.hunt.history.push({\n            stage: this.gameState.player.hunt.stage,\n            huntLevel: this.getHuntLevel(),\n            finishedAt: time,\n            startedAt: this.gameState.player.hunt.startedAt,\n        });\n        this.gameState.player.hunt.stage = stage;\n        this.gameState.player.hunt.startedAt = time;\n        this.updateHuntLevel();\n    }\n    getHuntLevel() {\n        return this.updateHuntLevel();\n    }\n    updateHuntLevel() {\n        let huntLevel = 1;\n        while (this.gameState.player.hunt.stage >= this.getHuntLevelNextStage(huntLevel)) {\n            huntLevel++;\n        }\n        this.huntLevel = huntLevel;\n        return huntLevel;\n    }\n    getHuntLevelNextStage(huntLevel) {\n        var _a;\n        (_a = this.huntLevelFormula) !== null && _a !== void 0 ? _a : (this.huntLevelFormula = parser.parse(this.configManager.getConstants().huntLevelRequirments));\n        return Math.round(this.huntLevelFormula.evaluate({ huntLevel }));\n    }\n    idlerCalcProduction(huntLevel) {\n        var _a, _b, _c, _d;\n        const constants = this.configManager.getConstants();\n        (_a = this.idleRewardGoldFormula) !== null && _a !== void 0 ? _a : (this.idleRewardGoldFormula = parser.parse(constants.idleRewardGold));\n        (_b = this.idleRewardGreenMoonDropsFormula) !== null && _b !== void 0 ? _b : (this.idleRewardGreenMoonDropsFormula = parser.parse(constants.idleRewardGreenMoonDrops));\n        (_c = this.idleRewardPurpleMoonDropsFormula) !== null && _c !== void 0 ? _c : (this.idleRewardPurpleMoonDropsFormula = parser.parse(constants.idleRewardPurpleMoonDrops));\n        (_d = this.idleRewardVSleepFormula) !== null && _d !== void 0 ? _d : (this.idleRewardVSleepFormula = parser.parse(constants.idleRewardVSleep));\n        return [\n            {\n                resourceType: types_1.ResourceType.gold,\n                amountPerMinute: this.idleRewardGoldFormula.evaluate({ huntLevel }),\n            },\n            {\n                resourceType: types_1.ResourceType.greenMoonDrop,\n                amountPerMinute: this.idleRewardGreenMoonDropsFormula.evaluate({ huntLevel }),\n            },\n            {\n                resourceType: types_1.ResourceType.purpleMoonDrop,\n                amountPerMinute: this.idleRewardPurpleMoonDropsFormula.evaluate({ huntLevel }),\n            },\n            {\n                resourceType: types_1.ResourceType.vSleep,\n                amountPerMinute: this.idleRewardVSleepFormula.evaluate({ huntLevel }),\n            },\n        ];\n    }\n    calcIdlerRewardsProduced(currentHuntLevel, lastClaim, now) {\n        const constants = this.configManager.getConstants();\n        const idleMaxMinutes = constants.idleMaxMinutes;\n        if (lastClaim > now || this.gameState.player.hunt.startedAt > now) {\n            throw new Error(\"do not play with time\");\n        }\n        if (now - lastClaim < 1000 * 60) {\n            return [];\n        }\n        let minutesUsed = 0;\n        const rewardsMap = {};\n        // 1) finished stages since lastClaim\n        for (const { startedAt, finishedAt, huntLevel } of this.gameState.player.hunt.history) {\n            if (minutesUsed >= idleMaxMinutes)\n                break;\n            // overlap window (lastClaim, now]\n            const from = Math.max(startedAt, lastClaim);\n            const to = Math.min(finishedAt, now);\n            const totalMin = Math.max(0, (to - from) / (1000 * 60));\n            const usableMin = Math.min(totalMin, idleMaxMinutes - minutesUsed);\n            this.addProduction(rewardsMap, huntLevel, usableMin);\n            minutesUsed += usableMin;\n        }\n        // 2) ongoing current stage\n        if (minutesUsed < idleMaxMinutes) {\n            const from = Math.max(this.gameState.player.hunt.startedAt, lastClaim);\n            const totalMin = Math.max(0, (now - from) / (1000 * 60));\n            const usableMin = Math.min(totalMin, idleMaxMinutes - minutesUsed);\n            this.addProduction(rewardsMap, currentHuntLevel, usableMin);\n        }\n        return Object.entries(rewardsMap).map(([res, amt]) => ({\n            resourceType: res,\n            amount: amt,\n        }));\n    }\n    /** Helper to accumulate production into a map. */\n    addProduction(rewardsMap, huntLevel, minutes) {\n        var _a;\n        if (minutes <= 0)\n            return;\n        const prod = this.idlerCalcProduction(huntLevel);\n        for (const { resourceType, amountPerMinute } of prod) {\n            let total = 0;\n            if (amountPerMinute >= 1) {\n                const whole = Math.floor(minutes);\n                const fraction = minutes - whole;\n                const unit = Math.round(amountPerMinute);\n                total = unit * whole;\n                if (fraction > 0) {\n                    total += Math.round(amountPerMinute * fraction);\n                }\n            }\n            else {\n                // For very low rates, accumulate across the entire span then round once\n                total = Math.round(amountPerMinute * minutes);\n            }\n            if (total > 0) {\n                rewardsMap[resourceType] = ((_a = rewardsMap[resourceType]) !== null && _a !== void 0 ? _a : 0) + total;\n            }\n        }\n    }\n    claimIdler() {\n        const now = this.timeService.now();\n        const lastClaim = this.gameState.player.meta.idlerLastClaim;\n        const huntLevel = this.getHuntInfo().huntLevel;\n        const rewards = this.calcIdlerRewardsProduced(huntLevel, lastClaim, now);\n        // mark claim time\n        this.setMeta({ idlerLastClaim: now });\n        // remove only consumed history entries\n        this.gameState.player.hunt.history = this.gameState.player.hunt.history.filter((entry) => entry.finishedAt > lastClaim);\n        return rewards;\n    }\n    setSupporterPackPurchasedAt(supporterPackPurchasedAt) {\n        this.gameState.player.meta.supporterPackPurchasedAt = supporterPackPurchasedAt;\n    }\n    setSolanaAddress(solanaAddress) {\n        this.gameState.player.meta.solanaAddress = solanaAddress;\n    }\n    // we can check if month of purchase is the same as current month or have a date boundaries for a current season\n    isSupporter() {\n        return this.gameState.player.meta.supporterPackPurchasedAt != null;\n    }\n    isSolanaAddressLinked() {\n        return this.gameState.player.meta.solanaAddress != null;\n    }\n    getMetaDto() {\n        var _a;\n        return {\n            freeGachaLastClaim: this.gameState.player.meta.freeGachaLastClaim,\n            freeGachaNextClaim: this.getFreeGachaNextClaim(),\n            isSupporter: this.isSupporter(),\n            idlerLastClaim: this.gameState.player.meta.idlerLastClaim,\n            isSolanaAddressLinked: this.isSolanaAddressLinked(),\n            isReferral: this.gameState.player.meta.isReferral === true,\n            lastShareVSleepClaimDate: (_a = this.gameState.player.meta.lastShareVSleepClaimDate) !== null && _a !== void 0 ? _a : 0,\n        };\n    }\n    setMeta(data) {\n        this.gameState.player.meta = Object.assign(Object.assign({}, this.gameState.player.meta), data);\n    }\n    getUsername() {\n        return this.gameState.player.username;\n    }\n    setUsername(username) {\n        this.gameState.player.username = username;\n    }\n    getFreeGachaNextClaim() {\n        let freeGachaNextClaimDate;\n        if (this.gameState.player.meta.freeGachaLastClaim !== 0) {\n            freeGachaNextClaimDate =\n                this.gameState.player.meta.freeGachaLastClaim +\n                    this.configManager.getConstants().gachaFreeClaimInterval * 60 * 60 * 1000;\n        }\n        else {\n            freeGachaNextClaimDate = this.timeService.now();\n        }\n        return freeGachaNextClaimDate;\n    }\n    getPlayerId() {\n        return this.gameState.player.userId;\n    }\n    getConfig() {\n        const { accountConfig } = this.configManager.getConfig(\"base\");\n        return accountConfig;\n    }\n};\nexports.PlayerEntity = PlayerEntity;\nexports.PlayerEntity = PlayerEntity = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.ITimeService)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.InitialGameState)),\n    tslib_1.__param(2, (0, inversify_1.inject)(symbols_1.Symbols.IHeroFactory)),\n    tslib_1.__param(3, (0, inversify_1.inject)(symbols_1.Symbols.IConfigManager))\n], PlayerEntity);\n\n},{\"../../types\":367,\"../symbols\":351,\"expr-eval\":254,\"inversify\":278,\"tslib\":315}],333:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ResourceManager = void 0;\nconst tslib_1 = require(\"tslib\");\nconst symbols_1 = require(\"../symbols\");\nconst inversify_1 = require(\"inversify\");\nlet ResourceManager = class ResourceManager {\n    constructor(timeService, gameState, configManager) {\n        this.timeService = timeService;\n        this.gameState = gameState;\n        this.configManager = configManager;\n        this.furnitureMap = new Map();\n        for (const furniture of this.gameState.player.resources.furniture) {\n            const parsedFurniture = this.parseFurnitureId(furniture);\n            this.furnitureMap.set(parsedFurniture.furnitureName, parsedFurniture);\n        }\n    }\n    parseFurnitureId(furnitureId) {\n        const parts = furnitureId.split(\"_\"); // \"bed_type_1_lvl_2\" -> [\"bed\", \"type\", \"1\", \"lvl\", \"2\"]\n        if (parts.length !== 5 || parts[1] !== \"type\" || parts[3] !== \"lvl\") {\n            throw new Error();\n        }\n        const furnitureType = parseInt(parts[2]);\n        const furnitureLevel = parseInt(parts[4]);\n        if (isNaN(furnitureType) || isNaN(furnitureLevel)) {\n            throw new Error();\n        }\n        return {\n            furnitureId,\n            furnitureName: parts[0],\n            furnitureType,\n            furnitureLevel,\n        };\n    }\n    addFurniture(furnitureId) {\n        const parsedFurniture = this.parseFurnitureId(furnitureId);\n        const existing = this.furnitureMap.get(parsedFurniture.furnitureName);\n        this.furnitureMap.set(parsedFurniture.furnitureName, parsedFurniture);\n        if (existing != null) {\n            const { furniture } = this.gameState.player.resources;\n            const index = furniture.indexOf(existing.furnitureId);\n            if (index !== -1) {\n                furniture.splice(index, 1);\n            }\n        }\n        this.gameState.player.resources.furniture.push(furnitureId);\n        this.gameState.player.previouslyAddedFurniture.push(furnitureId);\n    }\n    getFurnitureList() {\n        return [...this.furnitureMap.values()].map((el) => el.furnitureId);\n    }\n    // Returns a list of furniture ids that were previously claimed by the player as rewards.\n    // Useful to avoid repeated generation of the same items.\n    getPreviouslyAddedFurnitureList() {\n        return this.gameState.player.previouslyAddedFurniture;\n    }\n    addResidual(resourceType, amount) {\n        this.gameState.player.resourcesResidual[resourceType] += amount;\n    }\n    checkResidual(resourceType) {\n        return this.gameState.player.resourcesResidual[resourceType] >= 1;\n    }\n    getResidual(resourceType) {\n        if (!this.checkResidual(resourceType)) {\n            return 0;\n        }\n        const intPart = Math.floor(this.gameState.player.resourcesResidual[resourceType]);\n        this.gameState.player.resourcesResidual[resourceType] -= intPart;\n        return intPart;\n    }\n};\nexports.ResourceManager = ResourceManager;\nexports.ResourceManager = ResourceManager = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.ITimeService)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.InitialGameState)),\n    tslib_1.__param(2, (0, inversify_1.inject)(symbols_1.Symbols.IConfigManager))\n], ResourceManager);\n\n},{\"../symbols\":351,\"inversify\":278,\"tslib\":315}],334:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RewardManager = void 0;\nconst tslib_1 = require(\"tslib\");\nconst inversify_1 = require(\"inversify\");\nconst types_1 = require(\"../../types\");\nconst symbols_1 = require(\"../symbols\");\nlet RewardManager = class RewardManager {\n    constructor(player, inventoryEntity, resourceManager) {\n        this.player = player;\n        this.inventoryEntity = inventoryEntity;\n        this.resourceManager = resourceManager;\n    }\n    applyReward(reward) {\n        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;\n        switch (reward.type) {\n            case types_1.ResourceType.gold:\n                this.player.addGold(this.round(reward.type, (_b = (_a = reward.variant) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : 0));\n                return reward;\n            case types_1.ResourceType.gem:\n                this.player.addGems((_d = (_c = reward.variant) === null || _c === void 0 ? void 0 : _c.amount) !== null && _d !== void 0 ? _d : 0);\n                return reward;\n            case types_1.ResourceType.xp:\n                this.player.addExperience((_f = (_e = reward.variant) === null || _e === void 0 ? void 0 : _e.amount) !== null && _f !== void 0 ? _f : 0);\n                return reward;\n            case types_1.ResourceType.greenMoonDrop:\n                this.inventoryEntity.addResource({ resourceType: types_1.ResourceType.greenMoonDrop }, this.round(reward.type, (_h = (_g = reward.variant) === null || _g === void 0 ? void 0 : _g.amount) !== null && _h !== void 0 ? _h : 0));\n                return reward;\n            case types_1.ResourceType.purpleMoonDrop:\n                this.inventoryEntity.addResource({ resourceType: types_1.ResourceType.purpleMoonDrop }, this.round(reward.type, (_k = (_j = reward.variant) === null || _j === void 0 ? void 0 : _j.amount) !== null && _k !== void 0 ? _k : 0));\n                return reward;\n            case types_1.ResourceType.gachaToken:\n                this.inventoryEntity.addResource({ resourceType: types_1.ResourceType.gachaToken }, (_m = (_l = reward.variant) === null || _l === void 0 ? void 0 : _l.amount) !== null && _m !== void 0 ? _m : 0);\n                return reward;\n            case types_1.ResourceType.heroStarDust:\n                this.inventoryEntity.addResource({ resourceType: types_1.ResourceType.heroStarDust, heroRarity: reward.payload.heroRarity }, reward.amount);\n                return reward;\n            case types_1.ResourceType.furniture:\n                this.resourceManager.addFurniture(reward.payload.furnitureId);\n                return reward;\n            case types_1.ResourceType.heroCard:\n                return this.applyHeroCard(reward);\n            case types_1.ResourceType.vSleep:\n                this.player.addVSleep(this.round(reward.type, (_p = (_o = reward.variant) === null || _o === void 0 ? void 0 : _o.amount) !== null && _p !== void 0 ? _p : 0));\n                return reward;\n            default:\n                throw new Error(\"not implemented\");\n        }\n    }\n    applyHeroCard(reward) {\n        const exists = this.player.hasHero(reward.payload.heroType);\n        if (exists) {\n            this.inventoryEntity.addResource({ resourceType: reward.type, heroType: reward.payload.heroType }, 1);\n        }\n        else {\n            this.player.addUserHero(reward.payload.heroType);\n        }\n        return reward;\n    }\n    round(resourceType, amount) {\n        if (amount == null)\n            return 0;\n        const intAmount = Math.floor(amount);\n        this.resourceManager.addResidual(resourceType, amount - intAmount);\n        return intAmount + this.resourceManager.getResidual(resourceType);\n    }\n};\nexports.RewardManager = RewardManager;\nexports.RewardManager = RewardManager = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.IPlayerEntity)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.IInventoryEntity)),\n    tslib_1.__param(2, (0, inversify_1.inject)(symbols_1.Symbols.IResourceManager))\n], RewardManager);\n\n},{\"../../types\":367,\"../symbols\":351,\"inversify\":278,\"tslib\":315}],335:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SleepEntity = void 0;\nconst tslib_1 = require(\"tslib\");\nconst dayjs_1 = tslib_1.__importDefault(require(\"dayjs\"));\nconst isSameOrAfter_1 = tslib_1.__importDefault(require(\"dayjs/plugin/isSameOrAfter\"));\nconst inversify_1 = require(\"inversify\");\nconst symbols_1 = require(\"../symbols\");\nconst types_1 = require(\"../types\");\ndayjs_1.default.extend(isSameOrAfter_1.default);\nlet SleepEntity = class SleepEntity {\n    constructor(timeService, gameState, uuidGenerator, sleepBonusCalculator, narrativeService) {\n        this.timeService = timeService;\n        this.gameState = gameState;\n        this.uuidGenerator = uuidGenerator;\n        this.sleepBonusCalculator = sleepBonusCalculator;\n        this.narrativeService = narrativeService;\n    }\n    get lastClaimedAt() {\n        return this.gameState.player.sleep.lastClaimedAt;\n    }\n    get nextDaySleepSchedule() {\n        return this.gameState.player.sleep.nextDaySleepSchedule;\n    }\n    get streak() {\n        return this.gameState.player.sleep.streak;\n    }\n    get lastClaimTzOffsetSeconds() {\n        return this.gameState.player.sleep.lastClaimTzOffsetSeconds;\n    }\n    get lastClaimResult() {\n        return this.gameState.player.sleep.lastClaimResult;\n    }\n    get lastSleepInfo() {\n        if (this.gameState.player.sleep.lastSleepInfo == null) {\n            const sleepInfo = {\n                quality: types_1.SleepQuality.noData,\n                survey: {},\n                narrative: this.narrativeService.getNarrativeForSleep(types_1.SleepQuality.noData, []),\n                stages: [],\n            };\n            this.setLastSleepInfo(sleepInfo);\n            return sleepInfo;\n        }\n        return this.gameState.player.sleep.lastSleepInfo;\n    }\n    get sleepEvents() {\n        return this.gameState.player.sleep.sleepEvents;\n    }\n    get sleepSchedule() {\n        return this.gameState.player.sleep.sleepSchedule;\n    }\n    get sleepScheduleUnset() {\n        return this.gameState.player.sleep.sleepScheduleUnset;\n    }\n    isAlreadyClaimedToday(tzOffsetSeconds) {\n        const beginningOfDayWithOffset = (0, dayjs_1.default)(this.timeService.now())\n            .add(tzOffsetSeconds, \"seconds\")\n            .startOf(\"day\")\n            .subtract(tzOffsetSeconds, \"seconds\");\n        return this.lastClaimedAt != null && (0, dayjs_1.default)(this.lastClaimedAt).isSameOrAfter(beginningOfDayWithOffset);\n    }\n    setSleepSchedule(sleepSchedule) {\n        this.gameState.player.sleep.sleepSchedule = sleepSchedule;\n        this.gameState.player.sleep.sleepScheduleUnset = false;\n    }\n    setNextDaySleepSchedule(sleepSchedule) {\n        this.gameState.player.sleep.nextDaySleepSchedule = sleepSchedule;\n    }\n    applyNextDaySleepSchedule() {\n        if (this.nextDaySleepSchedule == null) {\n            throw new Error(\"Next day sleep schedule is not set\");\n        }\n        this.gameState.player.sleep.sleepSchedule = this.nextDaySleepSchedule;\n        this.gameState.player.sleep.sleepScheduleUnset = false;\n        this.gameState.player.sleep.nextDaySleepSchedule = undefined;\n    }\n    addSleepEvent(event) {\n        const createdAt = this.timeService.getDate().toISOString();\n        this.gameState.player.sleep.sleepEvents.push(Object.assign(Object.assign({}, event), { id: this.uuidGenerator.generateUuid(), createdAt }));\n        if (this.lastClaimedAt == null || this.lastClaimedAt < createdAt) {\n            this.gameState.player.sleep.lastClaimedAt = createdAt;\n            this.gameState.player.sleep.lastClaimTzOffsetSeconds = event.payload.tzOffsetSeconds;\n            this.gameState.player.sleep.lastClaimResult = {\n                sleepBox: {\n                    level: event.payload.sleepBoxLevel,\n                },\n                rewards: event.payload.rewards,\n                furniture: event.payload.furniture,\n                daysWithManualData: event.eventType === types_1.SleepClaimType.manual || event.eventType === types_1.SleepClaimType.claimOnly\n                    ? event.payload.daysWithManualData\n                    : 0,\n            };\n        }\n    }\n    setStreakInfo(streakInfo) {\n        this.gameState.player.sleep.streak = Object.assign(Object.assign({}, this.streak), streakInfo);\n    }\n    setLastSleepInfo(lastSleepInfo) {\n        this.gameState.player.sleep.lastSleepInfo = lastSleepInfo;\n    }\n    getWeekSleepData(tzOffsetSeconds) {\n        const SUNDAY = 0;\n        const MONDAY = 1;\n        const getLastWeekDay = (weekDayNumber, tzOffsetSeconds) => {\n            const now = (0, dayjs_1.default)(this.timeService.now());\n            let weekDay = (0, dayjs_1.default)(now).add(tzOffsetSeconds, \"seconds\").day(weekDayNumber).startOf(\"day\");\n            if (weekDay.isAfter(now)) {\n                weekDay = weekDay.subtract(1, \"week\");\n            }\n            return weekDay;\n        };\n        const getSleepEventsFrom = (from) => {\n            const events = this.sleepEvents\n                .filter((event) => (0, dayjs_1.default)(event.payload.sleepDay, \"YYYY-MM-DD\").isSameOrAfter(from))\n                .sort((a, b) => new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime());\n            return events;\n        };\n        const mapWeekEvents = (events, startWeekDay, from) => ({ quality, weekDay }) => {\n            const dayEvent = events.find((e) => (0, dayjs_1.default)(e.payload.sleepDay)\n                .startOf(\"day\")\n                .isSame((0, dayjs_1.default)(from)\n                .add(weekDay - startWeekDay, \"day\")\n                .startOf(\"day\")));\n            if (dayEvent == null)\n                return { quality, weekDay };\n            const isClaimOnly = (dayEvent.eventType != null && dayEvent.eventType === types_1.SleepClaimType.claimOnly) ||\n                dayEvent.payload.actualSleepDuration == null;\n            if (isClaimOnly)\n                return { quality, weekDay };\n            const { actualSleepDuration: duration, goToBedDelta, goToBedGoal, wakeUpDelta, wakeUpGoal, } = dayEvent.payload;\n            const durationDelta = -goToBedDelta + wakeUpDelta;\n            return {\n                quality: this.sleepBonusCalculator.getSleepQuality(goToBedDelta, durationDelta, duration),\n                weekDay,\n                duration: Math.round(duration),\n                goToBedDelta: Math.round(goToBedDelta),\n                wakeUpDelta: Math.round(wakeUpDelta),\n                wakeUpGoal,\n                goToBedGoal,\n            };\n        };\n        const getWeekDataFrom = (day, tzOffsetSeconds) => {\n            const lastDay = getLastWeekDay(day, tzOffsetSeconds);\n            const events = getSleepEventsFrom(lastDay);\n            const empty = Array.from({ length: 7 })\n                .fill({})\n                .map((_, idx) => ({\n                quality: types_1.SleepQuality.noData,\n                weekDay: idx + day,\n            }));\n            return empty.map(mapWeekEvents(events, day, lastDay));\n        };\n        return {\n            mondayWeek: getWeekDataFrom(MONDAY, tzOffsetSeconds),\n            sundayWeek: getWeekDataFrom(SUNDAY, tzOffsetSeconds),\n        };\n    }\n    setLastClaimedAt(lastClaimedAt) {\n        this.gameState.player.sleep.lastClaimedAt = lastClaimedAt;\n    }\n};\nexports.SleepEntity = SleepEntity;\nexports.SleepEntity = SleepEntity = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.ITimeService)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.InitialGameState)),\n    tslib_1.__param(2, (0, inversify_1.inject)(symbols_1.Symbols.IRpgUuidGenerator)),\n    tslib_1.__param(3, (0, inversify_1.inject)(symbols_1.Symbols.ISleepBonusCalculator)),\n    tslib_1.__param(4, (0, inversify_1.inject)(symbols_1.Symbols.INarrativeService))\n], SleepEntity);\n\n},{\"../symbols\":351,\"../types\":356,\"dayjs\":250,\"dayjs/plugin/isSameOrAfter\":252,\"inversify\":278,\"tslib\":315}],336:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GameContextState = exports.GameContext = exports.GameContextEnum = void 0;\nconst tslib_1 = require(\"tslib\");\n/** @module definitions */\nconst inversify_1 = require(\"inversify\");\nconst symbols_1 = require(\"./symbols\");\nconst types_1 = require(\"./types\");\n/** @public */\nvar GameContextEnum;\n(function (GameContextEnum) {\n    GameContextEnum[\"init\"] = \"init\";\n    GameContextEnum[\"default\"] = \"default\";\n    GameContextEnum[\"battle\"] = \"battle\";\n    GameContextEnum[\"hunt\"] = \"hunt\";\n})(GameContextEnum || (exports.GameContextEnum = GameContextEnum = {}));\n// The list of methods that contain the whole game state in their arguments or result that\n// should not be logged to the actions log to prevent circular references and large payloads\nconst actionNamesToSkipArgsAndResultLogging = [\"initGame\", \"saveGame\"];\nlet GameContext = class GameContext {\n    constructor(states, globalStates, initState, gameState) {\n        this.globalStates = globalStates;\n        this.gameState = gameState;\n        this.states = states.reduce((acc, state) => {\n            acc[state.getStateName()] = state;\n            return acc;\n        }, {});\n        Object.values(this.states).forEach((state) => {\n            state.setContext(this);\n        });\n        this.registerSelf();\n        this.bindActions();\n        this.state = this.states[initState];\n        this.bindCurrentStateActions();\n    }\n    getAvailableActionNames() {\n        return [\"getCurrentStateName\"];\n    }\n    getCurrentStateName() {\n        return this.state.getStateName();\n    }\n    changeState(state) {\n        if (this.states[state.contextName] == null) {\n            throw new Error(`unknown state -${state.contextName}`);\n        }\n        if (this.state != null) {\n            this.unbindCurrentStateActions();\n        }\n        this.state = this.states[state.contextName];\n        this.state.setContextState(state);\n        this.bindCurrentStateActions();\n    }\n    registerSelf() {\n        this.globalStates.push(this);\n    }\n    bindActions() {\n        const globalActions = new Set();\n        // bind global actions\n        for (const state of this.globalStates) {\n            for (const actionName of state.getAvailableActionNames()) {\n                if (globalActions.has(actionName)) {\n                    throw new Error(`Global action [${actionName}] is already defined`);\n                }\n                globalActions.add(actionName);\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n                if (state[actionName] == null) {\n                    throw new Error(`Action [${actionName}] is not defined in state [${state.constructor.name}]`);\n                }\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n                globalThis[actionName] = this.log(actionName, \n                // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-function-type\n                this.errorHandler(state[actionName].bind(state)), actionNamesToSkipArgsAndResultLogging.includes(actionName));\n            }\n        }\n        // bind state actions placeholders\n        for (const state of Object.values(this.states)) {\n            for (const actionName of state.getAvailableActionNames()) {\n                if (globalActions.has(actionName)) {\n                    throw new Error(`Action [${actionName}] is already defined as global action`);\n                }\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n                if (state[actionName] == null) {\n                    throw new Error(`Action [${actionName}] is not defined in state [${state.getStateName()}]`);\n                }\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n                globalThis[actionName] = this.createActionPlaceholder(actionName);\n            }\n        }\n    }\n    createActionPlaceholder(action) {\n        return () => ({\n            error: true,\n            key: types_1.ErrorKey.ValidationError,\n            details: `Action [${action}] is not available in current context [${this.getCurrentStateName()}]`,\n        });\n    }\n    unbindCurrentStateActions() {\n        for (const actionName of this.state.getAvailableActionNames()) {\n            // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n            globalThis[actionName] = this.createActionPlaceholder(actionName);\n        }\n    }\n    bindCurrentStateActions() {\n        for (const actionName of this.state.getAvailableActionNames()) {\n            // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n            globalThis[actionName] = this.log(actionName, \n            // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-function-type\n            this.errorHandler(this.state[actionName].bind(this.state)), actionNamesToSkipArgsAndResultLogging.includes(actionName));\n        }\n    }\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n    errorHandler(action) {\n        return (...args) => {\n            var _a;\n            try {\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call\n                return action(...args);\n            }\n            catch (err) {\n                if (err instanceof types_1.ConfigNeededError) {\n                    return {\n                        error: true,\n                        key: err.key,\n                        // eslint-disable-next-line @typescript-eslint/no-base-to-string\n                        details: (_a = err.message) !== null && _a !== void 0 ? _a : String(err),\n                    };\n                }\n                return {\n                    error: true,\n                    key: types_1.ErrorKey.InnerError,\n                    details: err instanceof Error ? err.message : String(err),\n                };\n            }\n        };\n    }\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n    log(actionName, action, skipArgsAndResult = false) {\n        return (...args) => {\n            var _a, _b, _c;\n            const payload = args.length > 0 ? { args } : {};\n            // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment\n            const result = (_a = action(...args)) !== null && _a !== void 0 ? _a : {};\n            if (((_b = this.gameState.envConfig) === null || _b === void 0 ? void 0 : _b.isActionsLogEnabled) === true) {\n                (_c = this.gameState.appliedActions) === null || _c === void 0 ? void 0 : _c.push({\n                    type: actionName,\n                    payload: skipArgsAndResult ? {} : payload,\n                    result: skipArgsAndResult ? {} : result,\n                    timestamp: new Date().getTime(),\n                });\n            }\n            // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n            return result;\n        };\n    }\n};\nexports.GameContext = GameContext;\nexports.GameContext = GameContext = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.multiInject)(symbols_1.Symbols.IGameContextState)),\n    tslib_1.__param(1, (0, inversify_1.multiInject)(symbols_1.Symbols.IGameContextGlobalState)),\n    tslib_1.__param(2, (0, inversify_1.inject)(symbols_1.Symbols.IGameContextInitialState)),\n    tslib_1.__param(3, (0, inversify_1.inject)(symbols_1.Symbols.InitialGameState))\n], GameContext);\nlet GameContextState = class GameContextState {\n    setContext(context) {\n        this.context = context;\n    }\n    changeGameContextTo(state) {\n        if (this.context == null) {\n            throw new Error(\"Game context is not set\");\n        }\n        this.context.changeState(state);\n    }\n};\nexports.GameContextState = GameContextState;\nexports.GameContextState = GameContextState = tslib_1.__decorate([\n    (0, inversify_1.injectable)()\n], GameContextState);\n\n},{\"./symbols\":351,\"./types\":356,\"inversify\":278,\"tslib\":315}],337:[function(require,module,exports){\n\"use strict\";\n/**\n *\n * After the game code is loaded game can be in one of the states (contexts)\n *\n * Just after the game is loaded it is in {@link InitGameState} state and only {@link InitGameState.initGame} action is available\n *\n * When game is initialized it changes to {@link DefaultGameState} state and actions from that state are available\n *\n * There is a special {@link GameGlobalState} that is always available and it is used to save game progress and get player info\n *\n * There is an example of how to use states in the game:\n * ```ts\n * engine.Invoke(\"initGame\", gameStateDump); // initializes game and changes state to DefaultGameState\n * engine.Invoke(\"getPathLegend\");\n * engine.Invoke(\"getPlayerInfo\"); // Always available because it is in GameGlobalState\n * engine.Invoke(\"go\"); // returns step reward. If player hits a battle it changes state to BattleGameState\n * // ...\n * ```\n *\n * For debugging purposes you can use `engine.Invoke(\"getCurrentStateName\")` to get the name of the current state\n *\n * Example on how to navigate through the battle\n *\n * ```ts\n * // in BattleGameState\n * engine.Invoke(\"getEnemySlots\"); // returns array of enemy slots for the first wave\n * engine.Invoke(\"startBattle\"); // starts the 1st wave, switches context to InBattleGameState\n *\n * // in InBattleGameState\n * engine.Invoke(\"getEnemySlots\"); // returns array of enemy slots for the current wave\n * var fightResult = engine.Invoke(\"fightCurrentWave\"); // fight the current wave\n *\n * if (fightResult.winner == \"enemy\") {\n *   // restart the fight, maybe next time you can use ultimate abilities more effectively\n *   fightResult = engine.Invoke(\"fightCurrentWave\");\n *   // or end the battle (and loose it)\n *   engine.Invoke(\"endBattle\");\n * }\n *\n * if (fightResult.winner == \"user\" && engine.Invoke(\"isBattleEnded\") != true) {\n *   engine.Invoke(\"advanceToNextWave\"); // advances to the next wave\n *   engine.Invoke(\"getEnemySlots\"); // returns array of enemy slots for the next wave\n *   fightResult = engine.Invoke(\"fightCurrentWave\"); // fight the next wave\n * }\n *\n * if (engine.Invoke(\"isBattleEnded\")) {\n *   engine.Invoke(\"endBattle\"); // ends the battle, returns battle rewards\n * }\n * ```\n *\n * @module GameContexts\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.initGame = exports.initGameAux = void 0;\nconst diContainer_1 = require(\"./diContainer\");\nconst symbols_1 = require(\"./symbols\");\nconst gameContext_1 = require(\"./gameContext\");\nconst types_1 = require(\"../types\");\nfunction initGameAux(container, gameStateDump) {\n    container.bind(symbols_1.Symbols.Container).toConstantValue(container);\n    const gameState = (0, types_1.HydratedGameStateValidator)(JSON.parse(gameStateDump));\n    const runtimeGameState = gameState;\n    const rngFactory = container.get(symbols_1.Symbols.IRNGFactory);\n    const rng = rngFactory.create(gameState._init.rng.seed);\n    container.bind(symbols_1.Symbols.RootRNG).toConstantValue(rng);\n    container.bind(symbols_1.Symbols.InitialGameState).toConstantValue(runtimeGameState);\n    container.resolve(gameContext_1.GameContext);\n    globalThis.initGame(gameState);\n}\nexports.initGameAux = initGameAux;\nfunction _initGame(gameStateDump) {\n    const container = (0, diContainer_1.createContainer)();\n    initGameAux(container, gameStateDump);\n}\nexports.initGame = _initGame;\nglobalThis.initGame = exports.initGame;\n// generally no logging is allowed in the bundle, however it takes debugging it to the next level of a nightmare\n// so, what we are doing is introducing in the bundle function called \"log\", which normally does nothing, however\n// during testing and development we are replacing \"log\" with \"console.log\" which:\n//  - allows us to perform debug\n//  - not crashes everything if \"log\" call in bundle will accidentally slip into production code\nglobalThis.log = () => { };\n\n},{\"../types\":367,\"./diContainer\":321,\"./gameContext\":336,\"./symbols\":351}],338:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BattleService = void 0;\nconst tslib_1 = require(\"tslib\");\nconst symbols_1 = require(\"../symbols\");\nconst inversify_1 = require(\"inversify\");\nlet BattleService = class BattleService {\n    constructor(configManager, heroFactory) {\n        this.configManager = configManager;\n        this.heroFactory = heroFactory;\n    }\n    getBattleConfig(battleId) {\n        const config = this.configManager.getBattle(battleId);\n        if (config == null) {\n            throw new Error(`Invalid battle configId: ${battleId}`);\n        }\n        return config;\n    }\n    getEnemies(battleId) {\n        const config = this.getBattleConfig(battleId);\n        return [\n            config.map((enemyConfig) => {\n                const enemy = this.heroFactory.createForDeck({\n                    heroType: enemyConfig.character,\n                    level: enemyConfig.level,\n                    stars: 1,\n                });\n                return Object.assign(Object.assign({}, enemy.toDto()), { position: { x: enemyConfig.x, y: enemyConfig.y } });\n            }),\n        ];\n    }\n};\nexports.BattleService = BattleService;\nexports.BattleService = BattleService = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.IConfigManager)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.IHeroFactory))\n], BattleService);\n\n},{\"../symbols\":351,\"inversify\":278,\"tslib\":315}],339:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HeroService = void 0;\nconst tslib_1 = require(\"tslib\");\nconst symbols_1 = require(\"../symbols\");\nconst inversify_1 = require(\"inversify\");\nconst types_1 = require(\"../../types\");\nconst expr_eval_1 = require(\"expr-eval\");\nconst parser = new expr_eval_1.Parser();\nlet HeroService = class HeroService {\n    constructor(player, configManager, inventoryEntity) {\n        this.player = player;\n        this.configManager = configManager;\n        this.inventoryEntity = inventoryEntity;\n    }\n    getUserHeroes() {\n        return this.player.getUserHeroes();\n    }\n    getUserHero(heroType) {\n        return this.player.getUserHero(heroType);\n    }\n    levelUpHero(heroType, isFree) {\n        const hero = this.player.getUserHero(heroType);\n        if (!isFree) {\n            const resourcesNeeded = this.countResourcesToLevelUpHero(heroType);\n            this.spendResources(resourcesNeeded);\n        }\n        hero.levelUp();\n        return hero.toDto();\n    }\n    countResourcesToLevelUpHero(heroType, targetLevel) {\n        const hero = this.player.getUserHero(heroType);\n        const level = targetLevel !== null && targetLevel !== void 0 ? targetLevel : hero.level;\n        return this.getLevelUpCost(level);\n    }\n    getLevelUpCost(level) {\n        const levelingCost = this.getConfig().leveling.cost;\n        const resources = {};\n        const keys = Object.keys(levelingCost);\n        for (const key of keys) {\n            const price = levelingCost[key][level];\n            if (price == null) {\n                throw new Error(`No cost for key: ${key}, item level ${level}`);\n            }\n            if (price > 0) {\n                resources[key] = price;\n            }\n        }\n        return resources;\n    }\n    starUpHero(heroType) {\n        const hero = this.player.getUserHero(heroType);\n        if (hero.stars >= hero.maxStars) {\n            throw new Error(\"hero max stars achieved\");\n        }\n        const heroCardPrice = Math.round(parser.evaluate(this.configManager.getConstants().starUpHeroCardCost, { stars: hero.stars }));\n        if (heroCardPrice > 0 && !this.inventoryEntity.hasHeroCard(hero.heroType, heroCardPrice)) {\n            throw new Error(\"not enough cards to level up\");\n        }\n        if (heroCardPrice > 0) {\n            this.inventoryEntity.spendHeroCard(hero.heroType, heroCardPrice);\n        }\n        if (heroCardPrice == null) {\n            throw new Error(\"no price for star up hero\");\n        }\n        hero.starUp();\n        return hero.toDto();\n    }\n    countResourcesToStarUpHero(heroType) {\n        const hero = this.player.getUserHero(heroType);\n        if (hero.stars >= hero.maxStars) {\n            return {};\n        }\n        const resources = {};\n        const heroCardPrice = Math.round(parser.evaluate(this.configManager.getConstants().starUpHeroCardCost, { stars: hero.stars }));\n        if (heroCardPrice > 0) {\n            resources[types_1.ResourceType.heroCard] = heroCardPrice;\n        }\n        return resources;\n    }\n    spendResources(resourcesNeeded) {\n        if (resourcesNeeded[types_1.ResourceType.gold] != null && !this.player.hasGold(resourcesNeeded[types_1.ResourceType.gold])) {\n            throw new Error(\"not enough gold to level up\");\n        }\n        if (resourcesNeeded[types_1.ResourceType.greenMoonDrop] != null &&\n            !this.inventoryEntity.hasResource(types_1.ResourceType.greenMoonDrop, resourcesNeeded[types_1.ResourceType.greenMoonDrop])) {\n            throw new Error(\"not enough greenMoonDrop to level up\");\n        }\n        if (resourcesNeeded[types_1.ResourceType.purpleMoonDrop] != null &&\n            !this.inventoryEntity.hasResource(types_1.ResourceType.purpleMoonDrop, resourcesNeeded[types_1.ResourceType.purpleMoonDrop])) {\n            throw new Error(\"not enough purpleMoonDrop to level up\");\n        }\n        if (resourcesNeeded[types_1.ResourceType.gold] != null && resourcesNeeded[types_1.ResourceType.gold] > 0) {\n            this.player.spendGold(resourcesNeeded[types_1.ResourceType.gold]);\n        }\n        if (resourcesNeeded[types_1.ResourceType.greenMoonDrop] != null && resourcesNeeded[types_1.ResourceType.greenMoonDrop] > 0) {\n            this.inventoryEntity.spendResource(types_1.ResourceType.greenMoonDrop, resourcesNeeded[types_1.ResourceType.greenMoonDrop]);\n        }\n        if (resourcesNeeded[types_1.ResourceType.purpleMoonDrop] != null && resourcesNeeded[types_1.ResourceType.purpleMoonDrop] > 0) {\n            this.inventoryEntity.spendResource(types_1.ResourceType.purpleMoonDrop, resourcesNeeded[types_1.ResourceType.purpleMoonDrop]);\n        }\n    }\n    getConfig() {\n        const { heroesConfig } = this.configManager.getConfig(\"base\");\n        return heroesConfig;\n    }\n};\nexports.HeroService = HeroService;\nexports.HeroService = HeroService = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.IPlayerEntity)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.IConfigManager)),\n    tslib_1.__param(2, (0, inversify_1.inject)(symbols_1.Symbols.IInventoryEntity))\n], HeroService);\n\n},{\"../../types\":367,\"../symbols\":351,\"expr-eval\":254,\"inversify\":278,\"tslib\":315}],340:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InventoryService = void 0;\nconst tslib_1 = require(\"tslib\");\nconst inversify_1 = require(\"inversify\");\nconst symbols_1 = require(\"../symbols\");\nlet InventoryService = class InventoryService {\n    constructor(player, inventoryEntity, rewardManager) {\n        this.player = player;\n        this.inventoryEntity = inventoryEntity;\n        this.rewardManager = rewardManager;\n    }\n    getAllByType(...args) {\n        return this.inventoryEntity.getAllByType(...args);\n    }\n    addInventoryitem(...args) {\n        return this.inventoryEntity.add(...args);\n    }\n};\nexports.InventoryService = InventoryService;\nexports.InventoryService = InventoryService = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.IPlayerEntity)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.IInventoryEntity)),\n    tslib_1.__param(2, (0, inversify_1.inject)(symbols_1.Symbols.IRewardManager))\n], InventoryService);\n\n},{\"../symbols\":351,\"inversify\":278,\"tslib\":315}],341:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PathService = void 0;\nconst tslib_1 = require(\"tslib\");\nconst inversify_1 = require(\"inversify\");\nconst symbols_1 = require(\"../symbols\");\nconst types_1 = require(\"../types\");\nlet PathService = class PathService {\n    constructor(player, rewardManager, timeService, rewardsGenerator, configManager, playerService) {\n        this.player = player;\n        this.rewardManager = rewardManager;\n        this.timeService = timeService;\n        this.rewardsGenerator = rewardsGenerator;\n        this.configManager = configManager;\n        this.playerService = playerService;\n    }\n    carouselSpin() {\n        // TODO: Implement a proper check for carousel ticket availability\n        // For now, we comment this out for a quick fix\n        // if (!this.player.hasHiddenResource(HiddenResourceType.carouselTicket)) {\n        //   throw new Error(\"no carousel spin available\");\n        // }\n        const rewards = this.rewardsGenerator.generateCarouselReward();\n        // this.player.spendHiddenResource(HiddenResourceType.carouselTicket);\n        return { rewards: rewards.map((reward) => this.applyReward(reward)) };\n    }\n    getPathLegend() {\n        const path = this.configManager.getConfig(\"currentPath\");\n        if (path == null) {\n            return {\n                error: true,\n                key: types_1.ErrorKey.NotFoundError,\n                details: \"currentPath not found\",\n            };\n        }\n        return path.map((step, stepId) => ({\n            stepId,\n            event: step.event,\n            nodePrefab: step.nodePrefab,\n        }));\n    }\n    teleport({ pathIdx, pathStep, pathStage, }) {\n        const { pathIdx: currentPathIdx } = this.player.getPathInfo();\n        if (pathIdx !== currentPathIdx) {\n            const moved = this.configManager.movePath(pathIdx);\n            if (!moved) {\n                return { endOfTheRoad: true };\n            }\n        }\n        const currentPath = this.configManager.getConfig(\"currentPath\");\n        if (currentPath == null) {\n            return { error: true, key: types_1.ErrorKey.ValidationError, details: \"path not found\" };\n        }\n        if (currentPath.length === 0) {\n            return { endOfTheRoad: true };\n        }\n        const currentStep = currentPath[pathStep];\n        if (currentStep == null) {\n            return { error: true, key: types_1.ErrorKey.ValidationError, details: \"path step not found\" };\n        }\n        this.player.setPathInfo({\n            pathIdx,\n            pathStep,\n            pathStage,\n            eventFinished: true,\n        });\n        return {};\n    }\n    getCurrentStep() {\n        const { pathStep } = this.player.getPathInfo();\n        const currentPath = this.configManager.getConfig(\"currentPath\");\n        if (currentPath == null) {\n            return { error: true, key: types_1.ErrorKey.InnerError, details: \"current path not found\" };\n        }\n        if (currentPath.length === 0) {\n            return { endOfTheRoad: true };\n        }\n        const currentStep = currentPath[pathStep];\n        if (currentStep == null) {\n            return { error: true, key: types_1.ErrorKey.InnerError, details: \"current step not found\" };\n        }\n        return currentStep;\n    }\n    go() {\n        if (!this.player.getPathInfo().eventFinished) {\n            return { error: true, key: types_1.ErrorKey.ValidationError, details: \"event not finished\" };\n        }\n        const moveResult = this.moveForward();\n        if (moveResult != null) {\n            return moveResult;\n        }\n        const { pathStep } = this.player.getPathInfo();\n        const currentPath = this.configManager.getConfig(\"currentPath\");\n        if (currentPath == null) {\n            return { error: true, key: types_1.ErrorKey.InnerError, details: \"current path not found\" };\n        }\n        if (currentPath.length === 0) {\n            return { endOfTheRoad: true };\n        }\n        const currentStep = currentPath[pathStep];\n        if (currentStep == null) {\n            return { error: true, key: types_1.ErrorKey.InnerError, details: \"current step not found\" };\n        }\n        return currentStep;\n    }\n    checkPathEnd() {\n        const { pathIdx, pathStep } = this.player.getPathInfo();\n        if (!this.configManager.isOnThePath(pathIdx)) {\n            this.player.setPathInfo({\n                pathIdx: pathIdx + 1,\n                pathStep: 0,\n                pathStage: \"\",\n                eventFinished: false,\n            });\n            return;\n        }\n        const currentPath = this.configManager.getConfig(\"currentPath\");\n        if (currentPath == null || currentPath.length === 0) {\n            return { endOfTheRoad: true };\n        }\n        const maxStep = currentPath.length - 1;\n        if (pathStep < maxStep) {\n            return;\n        }\n        const moved = this.configManager.movePath(pathIdx + 1);\n        if (!moved) {\n            return { endOfTheRoad: true };\n        }\n        const nextPath = this.configManager.getConfig(\"currentPath\");\n        if (nextPath != null && nextPath.length !== 0) {\n            this.player.setPathInfo({\n                pathIdx: pathIdx + 1,\n                pathStep: 0,\n                pathStage: \"\",\n                eventFinished: false,\n            });\n        }\n        else {\n            this.player.setPathInfo({\n                pathIdx,\n                pathStep: 0,\n                pathStage: \"\",\n                eventFinished: false,\n            });\n        }\n    }\n    eventFinishedHook(eventId) {\n        var _a;\n        const currentStep = this.getCurrentStep();\n        if (((_a = currentStep.eventParameter) !== null && _a !== void 0 ? _a : \"\") === (eventId !== null && eventId !== void 0 ? eventId : \"\")) {\n            this.player.setPathInfo({ eventFinished: true });\n        }\n    }\n    endStepHook() {\n        const { level: levelBefore } = this.playerService.getLevelInfo();\n        const { pathStep, eventFinished } = this.player.getPathInfo();\n        if (!eventFinished) {\n            return { error: true, key: types_1.ErrorKey.ValidationError, details: \"event not finished\" };\n        }\n        const currentPath = this.configManager.getConfig(\"currentPath\");\n        if (currentPath == null) {\n            return { error: true, key: types_1.ErrorKey.InnerError, details: \"current path not found\" };\n        }\n        if (currentPath.length === 0) {\n            return { rewards: [], levelUp: false, endOfTheRoad: true };\n        }\n        const currentStep = currentPath[pathStep];\n        if (currentStep == null) {\n            return { error: true, key: types_1.ErrorKey.InnerError, details: \"current step not found\" };\n        }\n        const error = this.checkPathEnd();\n        if (currentStep.reward == null) {\n            return Object.assign({ rewards: [], levelUp: false }, (error !== null && error !== void 0 ? error : {}));\n        }\n        const rewards = this.rewardsGenerator.generatePackRewards(currentStep.reward);\n        const appliedRewards = rewards.map((r) => this.applyReward(r));\n        const { level: levelAfter } = this.playerService.getLevelInfo();\n        return Object.assign({ rewards: appliedRewards, levelUp: levelAfter > levelBefore }, (error !== null && error !== void 0 ? error : {}));\n    }\n    getDialogue(dialogueId) {\n        const dialogue = this.configManager.getDialogue(dialogueId);\n        if (dialogue == null) {\n            return {\n                error: true,\n                key: types_1.ErrorKey.NotFoundError,\n                details: `dialogue ${dialogueId} not found`,\n            };\n        }\n        return dialogue;\n    }\n    moveForward() {\n        let { pathIdx, pathStep, pathStage } = this.player.getPathInfo();\n        const currentPath = this.configManager.getConfig(\"currentPath\");\n        if (currentPath == null) {\n            return { error: true, key: types_1.ErrorKey.InnerError, details: \"current path not found\" };\n        }\n        if (currentPath.length === 0) {\n            return { endOfTheRoad: true };\n        }\n        const maxStep = currentPath.length - 1;\n        if (pathStep >= maxStep) {\n            const moved = this.configManager.movePath(pathIdx + 1);\n            if (!moved) {\n                return { endOfTheRoad: true };\n            }\n            const nextPath = this.configManager.getConfig(\"currentPath\");\n            if (nextPath != null && nextPath.length > 0) {\n                pathIdx++;\n            }\n            else if (nextPath.length === 0) {\n                return { endOfTheRoad: true };\n            }\n            pathStep = 0;\n        }\n        else {\n            pathStep++;\n        }\n        this.player.setPathInfo({\n            pathIdx,\n            pathStep,\n            pathStage: pathStep >= maxStep ? \"\" : pathStage,\n            eventFinished: false,\n        });\n    }\n    applyReward(reward) {\n        switch (reward.type) {\n            /* case BoxType.chest:\n              return {\n                type: BoxType.chest,\n                content: this.rewardsGenerator.generateChestContent().map((item) => this.rewardManager.applyReward(item)),\n              }; */\n            /* case BoxType.sleepBox:\n              return {\n                type: BoxType.sleepBox,\n                content: this.rewardsGenerator.generateSleepBoxContent().map((item) => this.rewardManager.applyReward(item)),\n              }; */\n            default:\n                return this.rewardManager.applyReward(reward);\n        }\n    }\n};\nexports.PathService = PathService;\nexports.PathService = PathService = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.IPlayerEntity)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.IRewardManager)),\n    tslib_1.__param(2, (0, inversify_1.inject)(symbols_1.Symbols.ITimeService)),\n    tslib_1.__param(3, (0, inversify_1.inject)(symbols_1.Symbols.IRewardsGenerator)),\n    tslib_1.__param(4, (0, inversify_1.inject)(symbols_1.Symbols.IConfigManager)),\n    tslib_1.__param(5, (0, inversify_1.inject)(symbols_1.Symbols.IPlayerService))\n], PathService);\n\n},{\"../symbols\":351,\"../types\":356,\"inversify\":278,\"tslib\":315}],342:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PlayerService = void 0;\nconst tslib_1 = require(\"tslib\");\nconst symbols_1 = require(\"../symbols\");\nconst inversify_1 = require(\"inversify\");\nconst types_1 = require(\"../types\");\nconst types_2 = require(\"../../types\");\nconst dayjs_1 = tslib_1.__importDefault(require(\"dayjs\"));\nconst bigVal_1 = require(\"../utils/bigVal\");\nlet PlayerService = class PlayerService {\n    constructor(timeService, player, resourceManager, sleep, configManager, rewardManager) {\n        this.timeService = timeService;\n        this.player = player;\n        this.resourceManager = resourceManager;\n        this.sleep = sleep;\n        this.configManager = configManager;\n        this.rewardManager = rewardManager;\n    }\n    getPlayerInfo() {\n        var _a, _b, _c, _d, _e;\n        const playerId = (_a = this.player.getPlayerId()) !== null && _a !== void 0 ? _a : \"0\";\n        const { pathIdx, pathStep, pathStage } = this.player.getPathInfo();\n        const currentPath = this.configManager.getConfig(\"currentPath\");\n        if (currentPath == null) {\n            return { error: true, key: types_1.ErrorKey.InnerError, details: \"current path not found\" };\n        }\n        const { level, maxLevel } = this.getLevelInfo();\n        return {\n            playerId,\n            level,\n            maxLevel,\n            xp: this.player.getExperience(),\n            // not really used here\n            // gold: this.player.getGold(),\n            gems: this.player.getGems(),\n            vSleep: this.player.getVSleep(),\n            resources: {\n                [types_2.ResourceType.furniture]: this.resourceManager.getFurnitureList(),\n            },\n            pathIdx,\n            pathStep,\n            pathStage,\n            pathMaxStep: currentPath.length - 1,\n            sc: (0, bigVal_1.toBigVal)(this.player.getGold()),\n            hc: (0, bigVal_1.toBigVal)(this.player.getGems()),\n            hidden: {\n                [types_2.HiddenResourceType.carouselTicket]: this.player.getHiddenResource(types_2.HiddenResourceType.carouselTicket),\n            },\n            sleep: {\n                lastClaimedAt: (_b = this.sleep.lastClaimedAt) !== null && _b !== void 0 ? _b : (0, dayjs_1.default)(this.timeService.now()).subtract(1, \"day\").startOf(\"day\").toISOString(),\n                sleepSchedule: this.sleep.sleepSchedule,\n                nextDaySleepSchedule: this.sleep.nextDaySleepSchedule,\n                lastSleepInfo: Object.assign(Object.assign({}, this.sleep.lastSleepInfo), { sleepPoints: (_d = (_c = this.sleep.lastSleepInfo) === null || _c === void 0 ? void 0 : _c.sleepPoints) !== null && _d !== void 0 ? _d : 0 }),\n                weekSleepData: this.sleep.getWeekSleepData((_e = this.sleep.lastClaimTzOffsetSeconds) !== null && _e !== void 0 ? _e : 0),\n                streak: this.sleep.streak,\n            },\n            meta: this.player.getMetaDto(),\n            idler: this.player.getIdlerInfo(),\n            username: this.player.getUsername(),\n        };\n    }\n    claimIdler() {\n        const rewards = this.player.claimIdler();\n        return rewards.map((reward) => this.rewardManager.applyReward({\n            type: reward.resourceType,\n            variant: { amount: reward.amount },\n        }));\n    }\n    getLevelInfo() {\n        const { level, maxLevel } = this.player.getLevel();\n        return {\n            level,\n            maxLevel,\n        };\n    }\n    addExperience(amount) {\n        this.player.addExperience(amount);\n    }\n    getUserHeroes() {\n        return this.player.getUserHeroes();\n    }\n    getUserHero(heroType) {\n        return this.player.getUserHero(heroType);\n    }\n};\nexports.PlayerService = PlayerService;\nexports.PlayerService = PlayerService = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.ITimeService)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.IPlayerEntity)),\n    tslib_1.__param(2, (0, inversify_1.inject)(symbols_1.Symbols.IResourceManager)),\n    tslib_1.__param(3, (0, inversify_1.inject)(symbols_1.Symbols.ISleepEntity)),\n    tslib_1.__param(4, (0, inversify_1.inject)(symbols_1.Symbols.IConfigManager)),\n    tslib_1.__param(5, (0, inversify_1.inject)(symbols_1.Symbols.IRewardManager))\n], PlayerService);\n\n},{\"../../types\":367,\"../symbols\":351,\"../types\":356,\"../utils/bigVal\":358,\"dayjs\":250,\"inversify\":278,\"tslib\":315}],343:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RewardsGenerator = void 0;\nconst tslib_1 = require(\"tslib\");\nconst types_1 = require(\"../../types\");\nconst inversify_1 = require(\"inversify\");\nconst symbols_1 = require(\"../symbols\");\nconst types_2 = require(\"../types\");\nconst SleepQualityToSleepBoxLevelMap = {\n    [types_2.SleepQuality.noData]: 1,\n    [types_2.SleepQuality.payAttention]: 1,\n    [types_2.SleepQuality.fair]: 2,\n    [types_2.SleepQuality.good]: 3,\n    [types_2.SleepQuality.perfect]: 4,\n};\nconst SleepQualityToFurnitureLevelMap = {\n    [types_2.SleepQuality.noData]: 1,\n    [types_2.SleepQuality.payAttention]: 1,\n    [types_2.SleepQuality.fair]: 1,\n    [types_2.SleepQuality.good]: 2,\n    [types_2.SleepQuality.perfect]: 3,\n};\nlet RewardsGenerator = class RewardsGenerator {\n    constructor(randomService, configManager, resourceManager) {\n        this.randomService = randomService;\n        this.configManager = configManager;\n        this.resourceManager = resourceManager;\n        this.battleEnabled = true;\n    }\n    setBattleEnabled(enable = !this.battleEnabled) {\n        this.battleEnabled = enable;\n    }\n    getBattleEnabled() {\n        return this.battleEnabled;\n    }\n    generatePackRewards(rewardId) {\n        const rewardConfigs = this.configManager.getRewardPack(rewardId);\n        if (rewardConfigs == null) {\n            throw new Error(`reward pack ${rewardId} not found`);\n        }\n        const rewards = [];\n        for (const rewardConfig of rewardConfigs) {\n            rewards.push(...this.generateRewardFromConfig(rewardConfig));\n        }\n        return rewards;\n    }\n    generateBoxContent(boxType, level) {\n        switch (boxType) {\n            case types_1.BoxType.sleepBox:\n                return this.generateSleepBoxContent(level);\n            default:\n                throw new Error(`unknown boxType: ${boxType}`);\n        }\n    }\n    generateSleepBoxContent(level) {\n        const configs = this.getSleepBoxConfig();\n        const config = configs.find((el) => el.sleepBoxLevel === level);\n        if (config == null) {\n            throw new Error(`generateSleepBoxContent config not found - ${JSON.stringify(level)}`);\n        }\n        const dropRules = {\n            heroRarity: [\n                {\n                    heroRarity: types_2.HeroRarity.epic,\n                    weight: config.epic,\n                },\n                {\n                    heroRarity: types_2.HeroRarity.legendary,\n                    weight: config.legendary,\n                },\n                {\n                    heroRarity: types_2.HeroRarity.rare,\n                    weight: config.rare,\n                },\n            ],\n        };\n        const heroes = [\n            config.hero1,\n            config.hero2,\n            config.hero3,\n            config.hero4,\n            config.hero5,\n            config.hero6,\n            config.hero7,\n        ]\n            .map((heroChance) => {\n            if (heroChance > 0 && this.randomService.yesNo(heroChance)) {\n                return {\n                    type: types_1.ResourceType.heroCard,\n                    payload: this.generateHeroCard(dropRules),\n                };\n            }\n            return undefined;\n        })\n            .filter((hero) => hero !== undefined);\n        return heroes;\n    }\n    generateCarouselReward() {\n        const rewardConfig = this.randomService.getRandomElement(this.getRewardsConfig().carouselRewards);\n        return this.generateRewardFromConfig(rewardConfig);\n    }\n    generateSleepReward(sleepQuality = types_2.SleepQuality.noData, sleepPoints = 0) {\n        const sleepBoxLevel = SleepQualityToSleepBoxLevelMap[sleepQuality];\n        return { type: types_1.BoxType.sleepBox, level: sleepBoxLevel };\n    }\n    generateDinoRoomRewardSet(sleepQuality = types_2.SleepQuality.noData) {\n        const { rare, epic, legendary } = this.getRewardsConfig().dinoRoomRewards;\n        const prevIdsRaw = this.resourceManager.getPreviouslyAddedFurnitureList();\n        const previouslyAddedFurnitureIds = new Set((Array.isArray(prevIdsRaw) ? prevIdsRaw : []).map((id) => String(id)));\n        const tierRare = rare.map(({ type, furnitureId }) => ({ type, furnitureId }));\n        const tierEpic = epic.map(({ type, furnitureId }) => ({ type, furnitureId }));\n        const tierLegendary = legendary.map(({ type, furnitureId }) => ({ type, furnitureId }));\n        const pickFromTier = (tierList, tierName) => {\n            const notOwned = tierList.filter((item) => !previouslyAddedFurnitureIds.has(item.furnitureId)); // TierItem[]\n            // Make sure the array we pass to getRandomElement is mutable (T[]) to satisfy its signature.\n            const pool = notOwned.length > 0 ? notOwned : Array.from(tierList);\n            if (pool.length === 0) {\n                throw new Error(`No furniture candidates available for tier \"${tierName}\". Check rewards config.`);\n            }\n            const pickedBase = this.randomService.getRandomElement(pool); // TierItem\n            // Build full IFurnitureRewardConfig only after picking\n            const cfg = {\n                type: types_1.ResourceType.furniture,\n                furnitureId: pickedBase.furnitureId,\n                amount: 1,\n                variantType: \"static\",\n            };\n            return this.generateRewardFromConfig(cfg)[0];\n        };\n        const tiers = [\n            { list: tierRare, minQuality: types_2.SleepQuality.noData, name: \"rare\" },\n            { list: tierEpic, minQuality: types_2.SleepQuality.good, name: \"epic\" },\n            { list: tierLegendary, minQuality: types_2.SleepQuality.perfect, name: \"legendary\" },\n        ];\n        const result = tiers.map(({ list, minQuality, name }) => {\n            const reward = pickFromTier(list, name);\n            return Object.assign(Object.assign({}, reward), { payload: Object.assign(Object.assign({}, reward.payload), { isSelectable: SleepQualityToFurnitureLevelMap[sleepQuality] >= SleepQualityToFurnitureLevelMap[minQuality], isClaimed: false }) });\n        });\n        return result;\n    }\n    generateRewardFromConfig(rewardConfig, alternativeDropRules) {\n        const rewards = [];\n        let amount = 0;\n        if (rewardConfig.variantType === \"static\") {\n            amount = rewardConfig.amount;\n        }\n        else if (rewardConfig.variantType === \"range\") {\n            amount = this.randomService.randomInt(rewardConfig.variants.maxAmount, rewardConfig.variants.minAmount);\n        }\n        else if (rewardConfig.variantType === \"weight\") {\n            const rewardVariant = this.randomService.getRandomWeightedElement(rewardConfig.variants, rewardConfig.variants.map((reward) => reward.weight));\n            amount = rewardVariant.amount;\n        }\n        rewards.push(...this.generateResourceRewards(rewardConfig, amount, alternativeDropRules));\n        return rewards;\n    }\n    generateResourceRewards(rewardConfig, amount, alternativeDropRules) {\n        const rewards = [];\n        if (rewardConfig.type === types_1.ResourceType.heroCard) {\n            rewards.push({\n                type: rewardConfig.type,\n                payload: this.generateHeroCard(alternativeDropRules != null ? alternativeDropRules[types_1.ResourceType.heroCard] : undefined),\n            });\n        }\n        else if (rewardConfig.type === types_1.ResourceType.heroStarDust) {\n            rewards.push({\n                type: rewardConfig.type,\n                payload: this.generateHeroStarDust(alternativeDropRules != null ? alternativeDropRules[types_1.ResourceType.heroStarDust] : undefined),\n                amount,\n            });\n        }\n        else if (rewardConfig.type === types_1.ResourceType.furniture) {\n            if (rewardConfig.furnitureId == null) {\n                throw new Error(\"random furniture generation is not implemented\");\n            }\n            rewards.push({\n                type: rewardConfig.type,\n                payload: Object.assign(Object.assign({}, this.resourceManager.parseFurnitureId(rewardConfig.furnitureId)), { isSelectable: false, isClaimed: false }),\n            });\n        }\n        else {\n            rewards.push({\n                type: rewardConfig.type,\n                variant: { amount },\n            });\n        }\n        return rewards;\n    }\n    generateHeroCard(alternativeRules) {\n        const rules = alternativeRules !== null && alternativeRules !== void 0 ? alternativeRules : this.getRewardsConfig().defaultDropRules[types_1.ResourceType.heroCard];\n        const { heroRarity } = this.randomService.getRandomWeightedElement(rules.heroRarity, rules.heroRarity.map((reward) => reward.weight));\n        const heroesToChooseFrom = this.getHeroesConfig().heroes.filter((h) => h.heroRarity === heroRarity && h.gachable);\n        return { heroType: this.randomService.getRandomElement(heroesToChooseFrom).heroType };\n    }\n    generateHeroStarDust(alternativeRules) {\n        const rules = alternativeRules !== null && alternativeRules !== void 0 ? alternativeRules : this.getRewardsConfig().defaultDropRules[types_1.ResourceType.heroStarDust];\n        const { heroRarity } = this.randomService.getRandomWeightedElement(rules.heroRarity, rules.heroRarity.map((reward) => reward.weight));\n        return { heroRarity };\n    }\n    getSleepBoxConfig() {\n        return this.configManager.getConfig(\"base\").sleepBoxConfig;\n    }\n    getRewardsConfig() {\n        return this.configManager.getConfig(\"base\").rewardsConfig;\n    }\n    getHeroesConfig() {\n        return this.configManager.getConfig(\"base\").heroesConfig;\n    }\n};\nexports.RewardsGenerator = RewardsGenerator;\nexports.RewardsGenerator = RewardsGenerator = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.IRandomService)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.IConfigManager)),\n    tslib_1.__param(2, (0, inversify_1.inject)(symbols_1.Symbols.IResourceManager))\n], RewardsGenerator);\n\n},{\"../../types\":367,\"../symbols\":351,\"../types\":356,\"inversify\":278,\"tslib\":315}],344:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RawSleepDataTransformer = exports.AndroidDataSource = exports.IOSDataSource = void 0;\nconst tslib_1 = require(\"tslib\");\nconst inversify_1 = require(\"inversify\");\nconst symbols_1 = require(\"../../symbols\");\nconst types_1 = require(\"./types\");\nconst dayjs_1 = tslib_1.__importDefault(require(\"dayjs\"));\nconst types_2 = require(\"../../types\");\n// TODO: wearables to be added\nvar IOSDataSource;\n(function (IOSDataSource) {\n    IOSDataSource[\"watch\"] = \"watch\";\n    IOSDataSource[\"iPhone\"] = \"iPhone\";\n    IOSDataSource[\"autoSleep\"] = \"autoSleep\";\n    IOSDataSource[\"unknownSource\"] = \"unknownSource\";\n})(IOSDataSource || (exports.IOSDataSource = IOSDataSource = {}));\nvar AndroidDataSource;\n(function (AndroidDataSource) {\n    AndroidDataSource[\"healthConnect\"] = \"healthConnect\";\n    AndroidDataSource[\"sleepApi\"] = \"sleepApi\";\n})(AndroidDataSource || (exports.AndroidDataSource = AndroidDataSource = {}));\nconst ANDROID_SLEEP_API_CONFIDENCE_THRESHOLD = 80;\nconst ANDROID_SLEEP_API_SKIP_THRESHOLD = 2;\nconst ANDROID_SLEEP_API_INTERVAL_THRESHOLD_MIN = 60;\nconst SLEEP_SESSION_CONTINUITY_THRESHOLD_MINUTES = 60;\nlet RawSleepDataTransformer = class RawSleepDataTransformer {\n    constructor(timeService) {\n        this.timeService = timeService;\n    }\n    transform(data) {\n        if (types_1.ClaimSheepManualParamsGuard.guard(data)) {\n            return this.addSurvey(data.survey, this.transformManual(data));\n        }\n        if (types_1.ClaimSheepIOSParamsGuard.guard(data)) {\n            const { rawSourceData: rawSleepData, tzOffsetSeconds } = data;\n            return this.addSurvey(data.survey, this.transformIOS({ rawSourceData: rawSleepData, tzOffsetSeconds }));\n        }\n        if (types_1.ClaimSheepAndroidParamsGuard.guard(data)) {\n            const { rawSourceData: rawSleepData, tzOffsetSeconds } = data;\n            return this.addSurvey(data.survey, this.transformAndroid({\n                rawSourceData: (0, types_1.AndroidSleepDataSchemaValidator)(JSON.parse(rawSleepData)),\n                tzOffsetSeconds,\n            }));\n        }\n        throw new Error(\"Unknown sleep data type schema\");\n    }\n    getEmptySleepData(rawSleepData) {\n        var _a;\n        return {\n            sleepDuration: 0,\n            goToBed: this.timeService.getDate(),\n            wakeUp: this.timeService.getDate(),\n            sourceId: \"\",\n            sourceType: \"\",\n            tzOffsetSeconds: 0,\n            survey: {\n                perceivedSleepQuality: (_a = rawSleepData.survey) === null || _a === void 0 ? void 0 : _a.perceivedSleepQuality,\n            },\n        };\n    }\n    // TODO: wearables vs iPhone priorities\n    transformIOS({ rawSourceData: rawSleepData, tzOffsetSeconds, stages }) {\n        var _a, _b;\n        const entries = rawSleepData.map((entry) => {\n            const parsedEntry = {\n                startDate: new Date(entry.startDate * 1000),\n                endDate: new Date(entry.endDate * 1000),\n                sourceRevision: this.parseIOSSourceRevisionMeta(entry.sourceRevision),\n                metadata: this.parseIOSMetadata(entry.metadata),\n            };\n            return Object.assign(Object.assign({}, parsedEntry), { userEntered: this.isIOSEntryUserEntered(entry, parsedEntry), stages });\n        });\n        // filter out entries that are not for this day\n        const now = this.timeService.getDate();\n        const notAfter = (0, dayjs_1.default)(now).add(tzOffsetSeconds, \"seconds\").endOf(\"day\").toDate();\n        const notBefore = (0, dayjs_1.default)(now).add(tzOffsetSeconds, \"seconds\").startOf(\"day\").subtract(1, \"day\").toDate();\n        const dateFilteredEntries = entries.filter((entry) => {\n            const startDateInTz = (0, dayjs_1.default)(entry.startDate).add(tzOffsetSeconds, \"seconds\").toDate();\n            return startDateInTz >= notBefore && startDateInTz < notAfter;\n        });\n        // filter out user entered entries\n        const userEnteredFilteredEntries = dateFilteredEntries.filter((entry) => !entry.userEntered);\n        // group by source\n        const groupedBySource = userEnteredFilteredEntries.reduce((acc, entry) => {\n            var _a;\n            const source = this.getSleepDataSource(entry);\n            const entries = (_a = acc[source]) !== null && _a !== void 0 ? _a : [];\n            entries.push(entry);\n            acc[source] = entries;\n            return acc;\n        }, {});\n        // group into continuous sleep sessions\n        const groupedBySourceContinuous = Object.entries(groupedBySource).reduce((acc, [source, entries]) => {\n            if (entries == null)\n                return acc;\n            const sortedEntries = entries.sort((a, b) => a.startDate.getTime() - b.startDate.getTime());\n            const continuousEntries = [];\n            for (const entry of sortedEntries) {\n                if (continuousEntries.length === 0) {\n                    continuousEntries.push(entry);\n                    continue;\n                }\n                const lastEntry = continuousEntries[continuousEntries.length - 1];\n                if (entry.startDate.getTime() - lastEntry.endDate.getTime() <=\n                    SLEEP_SESSION_CONTINUITY_THRESHOLD_MINUTES * 60 * 1000) {\n                    lastEntry.endDate = entry.endDate;\n                }\n                else {\n                    continuousEntries.push(entry);\n                }\n            }\n            acc[source] = continuousEntries;\n            return acc;\n        }, {});\n        // choose sessions ended today\n        const today = (0, dayjs_1.default)(now).add(tzOffsetSeconds, \"seconds\").startOf(\"day\").toDate();\n        const todayEntries = Object.entries(groupedBySourceContinuous).reduce((acc, [source, entries]) => {\n            if (entries == null)\n                return acc;\n            const todayEntries = entries.filter((entry) => (0, dayjs_1.default)(entry.endDate).add(tzOffsetSeconds, \"seconds\").toDate().getTime() >= today.getTime());\n            acc[source] = todayEntries;\n            return acc;\n        }, {});\n        // choose the longest session\n        const longestSession = Object.entries(todayEntries).reduce((acc, [source, entries]) => {\n            if (entries == null)\n                return acc;\n            const longestEntry = entries.reduce((acc, entry) => {\n                if (entry.endDate.getTime() - entry.startDate.getTime() > acc.endDate.getTime() - acc.startDate.getTime()) {\n                    return entry;\n                }\n                else {\n                    return acc;\n                }\n            }, entries[0]);\n            acc[source] = longestEntry;\n            return acc;\n        }, {});\n        let source;\n        let entry;\n        for (const [key, value] of Object.entries(longestSession)) {\n            if (key !== String(IOSDataSource.iPhone)) {\n                source = key;\n                entry = value;\n                break;\n            }\n        }\n        if (source == null || entry == null) {\n            [source, entry] = (_a = Object.entries(longestSession)[0]) !== null && _a !== void 0 ? _a : [];\n        }\n        if (source == null || entry == null) {\n            return {\n                sleepDuration: 0,\n                goToBed: this.timeService.getDate(),\n                wakeUp: this.timeService.getDate(),\n                sourceId: \"\",\n                sourceType: \"\",\n                tzOffsetSeconds,\n            };\n        }\n        return {\n            sleepDuration: (entry.endDate.getTime() - entry.startDate.getTime()) / 1000 / 60,\n            goToBed: entry.startDate,\n            wakeUp: entry.endDate,\n            sourceId: (_b = entry.sourceRevision.bundle) !== null && _b !== void 0 ? _b : \"\",\n            sourceType: source,\n            tzOffsetSeconds,\n        };\n    }\n    transformAndroid({ rawSourceData: rawSleepData, tzOffsetSeconds }) {\n        const now = this.timeService.getDate();\n        const notAfter = (0, dayjs_1.default)(now).add(tzOffsetSeconds, \"seconds\").endOf(\"day\").toDate();\n        const notBefore = (0, dayjs_1.default)(now).add(tzOffsetSeconds, \"seconds\").startOf(\"day\").subtract(1, \"day\").toDate();\n        if (rawSleepData.healthConnectData != null && rawSleepData.healthConnectData.length > 0) {\n            const matchingSessions = rawSleepData.healthConnectData.filter((session) => {\n                const stages = session.stages;\n                if (stages.length === 0)\n                    return false;\n                const firstStage = stages[0];\n                const lastStage = stages[stages.length - 1];\n                const { startTimeEpochMilli } = firstStage;\n                const { endTimeEpochMilli } = lastStage;\n                if (startTimeEpochMilli !== session.startTimeEpochMilli)\n                    return false;\n                if (endTimeEpochMilli !== session.endTimeEpochMilli)\n                    return false;\n                return startTimeEpochMilli >= notBefore.getTime() && endTimeEpochMilli <= notAfter.getTime();\n            });\n            if (matchingSessions.length > 0) {\n                const longestSession = matchingSessions.reduce((acc, session) => {\n                    const sessionDuration = session.endTimeEpochMilli - session.startTimeEpochMilli;\n                    const accDuration = acc.endTimeEpochMilli - acc.startTimeEpochMilli;\n                    if (sessionDuration > accDuration) {\n                        return session;\n                    }\n                    else {\n                        return acc;\n                    }\n                }, matchingSessions[0]);\n                const goToBed = new Date(longestSession.startTimeEpochMilli);\n                const wakeUp = new Date(longestSession.endTimeEpochMilli);\n                const sleepDuration = (wakeUp.getTime() - goToBed.getTime()) / 1000 / 60;\n                return {\n                    sleepDuration,\n                    goToBed,\n                    wakeUp,\n                    sourceId: longestSession.metadata.originPackageName,\n                    sourceType: AndroidDataSource.healthConnect,\n                    tzOffsetSeconds,\n                };\n            }\n        }\n        if (rawSleepData.sleepApiData != null && rawSleepData.sleepApiData.length > 0) {\n            const timeMatchingEvents = rawSleepData.sleepApiData.filter((event) => {\n                const eventTime = new Date(event.timestampSeconds * 1000);\n                if (eventTime < notBefore || eventTime > notAfter) {\n                    return false;\n                }\n                return true;\n            });\n            const timeMatchingEventsSorted = timeMatchingEvents.sort((a, b) => a.timestampSeconds - b.timestampSeconds);\n            const intervalPairs = [];\n            let skipped = 0;\n            let firstEvent = null;\n            let lastEvent = null;\n            for (let i = 0; i < timeMatchingEventsSorted.length; i++) {\n                const event = timeMatchingEventsSorted[i];\n                if (i === timeMatchingEventsSorted.length - 1) {\n                    if (event.confidence >= ANDROID_SLEEP_API_CONFIDENCE_THRESHOLD &&\n                        skipped < ANDROID_SLEEP_API_SKIP_THRESHOLD) {\n                        lastEvent = event;\n                    }\n                    if (firstEvent != null && lastEvent != null) {\n                        intervalPairs.push([firstEvent, lastEvent]);\n                    }\n                    break;\n                }\n                if (event.confidence < ANDROID_SLEEP_API_CONFIDENCE_THRESHOLD) {\n                    skipped++;\n                    continue;\n                }\n                if (skipped >= ANDROID_SLEEP_API_SKIP_THRESHOLD) {\n                    if (firstEvent != null && lastEvent != null) {\n                        intervalPairs.push([firstEvent, lastEvent]);\n                    }\n                    skipped = 0;\n                    firstEvent = null;\n                    lastEvent = null;\n                }\n                firstEvent !== null && firstEvent !== void 0 ? firstEvent : (firstEvent = event);\n                lastEvent = event;\n            }\n            if (intervalPairs.length === 0) {\n                return {\n                    sleepDuration: 0,\n                    goToBed: now,\n                    wakeUp: now,\n                    sourceId: \"\",\n                    sourceType: AndroidDataSource.sleepApi,\n                    tzOffsetSeconds,\n                };\n            }\n            // drop last interval if it is a zero legth interval\n            const lastPair = intervalPairs[intervalPairs.length - 1];\n            if (lastPair[0].timestampSeconds === lastPair[1].timestampSeconds)\n                intervalPairs.pop();\n            const longestSleepInterval = intervalPairs.reduce((acc, interval) => {\n                const intervalDuration = interval[1].timestampSeconds - interval[0].timestampSeconds;\n                const accDuration = acc[1].timestampSeconds - acc[0].timestampSeconds;\n                if (intervalDuration > accDuration) {\n                    return interval;\n                }\n                else {\n                    return acc;\n                }\n            });\n            const longestSleepIntervalIndex = intervalPairs.indexOf(longestSleepInterval);\n            // check sleeping intervals before the longest starting with the closest one\n            // if gap between them < [maxGapDurationSec] assume that user actually sleep in this period of time as well\n            // when we faced with gap >= [maxGapDurationSec] - skip all further interval as not relevant\n            let goToBedInterval = longestSleepInterval;\n            for (let i = longestSleepIntervalIndex; i > 0; i--) {\n                const curIntervalStartTime = intervalPairs[i][0].timestampSeconds;\n                const prevIntervalEndTime = intervalPairs[i - 1][1].timestampSeconds;\n                if (curIntervalStartTime - prevIntervalEndTime >= ANDROID_SLEEP_API_INTERVAL_THRESHOLD_MIN * 60)\n                    break;\n                goToBedInterval = intervalPairs[i - 1];\n            }\n            // check sleeping intervals after the longest starting with the closest one\n            // if gap between them < [maxGapDurationSec] assume that user actually sleep in this period of time as well\n            // when we faced with gap >= [maxGapDurationSec] - skip all further interval as not relevant\n            let wakeUpInterval = longestSleepInterval;\n            for (let i = longestSleepIntervalIndex; i < intervalPairs.length - 1; i++) {\n                const curIntervalEndTime = intervalPairs[i][1].timestampSeconds;\n                const nextIntervalStartTime = intervalPairs[i + 1][0].timestampSeconds;\n                if (nextIntervalStartTime - curIntervalEndTime >= ANDROID_SLEEP_API_INTERVAL_THRESHOLD_MIN * 60)\n                    break;\n                wakeUpInterval = intervalPairs[i + 1];\n            }\n            const goToBedTimeInSec = goToBedInterval[0].timestampSeconds;\n            const wakeUpTimeInSec = wakeUpInterval[1].timestampSeconds;\n            const sleepDurationSec = wakeUpTimeInSec - goToBedTimeInSec;\n            const sleepDuration = sleepDurationSec / 60;\n            const goToBed = new Date(goToBedTimeInSec * 1000);\n            const wakeUp = new Date(wakeUpTimeInSec * 1000);\n            return {\n                sleepDuration,\n                goToBed,\n                wakeUp,\n                sourceId: \"\",\n                sourceType: AndroidDataSource.sleepApi,\n                tzOffsetSeconds,\n            };\n        }\n        return {\n            sleepDuration: 0,\n            goToBed: now,\n            wakeUp: now,\n            sourceId: \"\",\n            sourceType: \"\",\n            tzOffsetSeconds,\n        };\n    }\n    transformManual({ rawSourceData: raw, tzOffsetSeconds, stages, }) {\n        const now = (0, dayjs_1.default)(this.timeService.getDate()).add(tzOffsetSeconds, \"seconds\");\n        if (raw == null) {\n            return {\n                sleepDuration: 0,\n                goToBed: now.toDate(),\n                wakeUp: now.toDate(),\n                sourceType: types_2.SleepClaimType.manual,\n                sourceId: \"\",\n                tzOffsetSeconds,\n                stages,\n            };\n        }\n        const wakeUpMoment = (0, dayjs_1.default)(raw.wakeUp, \"HH:mm\")\n            .year(now.year())\n            .month(now.month())\n            .date(now.date())\n            .subtract(tzOffsetSeconds, \"seconds\");\n        let goToBedMoment = (0, dayjs_1.default)(raw.goToBed, \"HH:mm\")\n            .year(now.year())\n            .month(now.month())\n            .date(now.date())\n            .subtract(tzOffsetSeconds, \"seconds\");\n        if (goToBedMoment.isAfter(wakeUpMoment)) {\n            goToBedMoment = goToBedMoment.subtract(1, \"day\");\n        }\n        const goToBed = goToBedMoment.toDate();\n        const wakeUp = wakeUpMoment.toDate();\n        const sleepDuration = (wakeUp.getTime() - goToBed.getTime()) / 1000 / 60;\n        return {\n            goToBed,\n            wakeUp,\n            sleepDuration,\n            sourceType: types_2.SleepClaimType.manual,\n            sourceId: \"\",\n            tzOffsetSeconds,\n            stages,\n        };\n    }\n    getSleepDataSource(entry) {\n        var _a;\n        const { productType, bundle } = entry.sourceRevision;\n        const isAppleWatch = (productType === null || productType === void 0 ? void 0 : productType.match(/^Watch\\d+,\\d+$/i)) != null;\n        if (isAppleWatch) {\n            return IOSDataSource.watch;\n        }\n        const isAutoSleep = this.isIOSAutoSleepEntry(entry);\n        if (isAutoSleep) {\n            return IOSDataSource.autoSleep;\n        }\n        const isIPhone = (_a = bundle === null || bundle === void 0 ? void 0 : bundle.toLowerCase().startsWith(\"com.apple.health.\")) !== null && _a !== void 0 ? _a : false;\n        if (isIPhone) {\n            return IOSDataSource.iPhone;\n        }\n        return IOSDataSource.unknownSource;\n    }\n    parseIOSSourceRevisionMeta(sourceRevision) {\n        return Object.fromEntries(sourceRevision\n            .trim()\n            .replace(/^<|>$/g, \"\")\n            .replace(/^\\w+ /g, \"\")\n            .split(\", \")\n            .map((entry) => {\n            const [key, value] = entry.split(\":\");\n            return [key, value === null || value === void 0 ? void 0 : value.trim()];\n        }));\n    }\n    parseIOSMetadata(metadata) {\n        if (metadata === \"\" || metadata === \"nil\")\n            return {};\n        return Object.fromEntries(metadata\n            .trim()\n            .replace(/^Optional\\(\\[|\\]\\)$/g, \"\")\n            .split(\", \")\n            .map((entry) => {\n            const [key, value] = entry.split(\":\");\n            return [key.replace(/^\"|\"$/g, \"\"), value === null || value === void 0 ? void 0 : value.trim()];\n        }));\n    }\n    isIOSEntryUserEntered(entry, parsedEntry) {\n        if ([entry.description, entry.metadata].some((entry) => /HKWasUserEntered(?:\": 1| = 1)/.exec(entry) != null)) {\n            return true;\n        }\n        if (this.isIOSAutoSleepEntry(parsedEntry)) {\n            return [entry.description, entry.metadata].some((entry) => /\\bEdit Slots\\b/i.exec(entry) != null);\n        }\n        return false;\n    }\n    isIOSAutoSleepEntry(entry) {\n        var _a;\n        return ((_a = entry.sourceRevision.bundle) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === \"com.tantsissa.autosleep\";\n    }\n    addSurvey(survey, transformed) {\n        return Object.assign(Object.assign({}, transformed), { survey: {\n                perceivedSleepQuality: survey === null || survey === void 0 ? void 0 : survey.perceivedSleepQuality,\n            } });\n    }\n};\nexports.RawSleepDataTransformer = RawSleepDataTransformer;\nexports.RawSleepDataTransformer = RawSleepDataTransformer = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.ITimeService))\n], RawSleepDataTransformer);\n\n},{\"../../symbols\":351,\"../../types\":356,\"./types\":350,\"dayjs\":250,\"inversify\":278,\"tslib\":315}],345:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SleepDataValidator = exports.TooManyManualClaimsError = exports.MultipleClaimsNotAllowedError = exports.ValidationError = void 0;\nconst tslib_1 = require(\"tslib\");\nconst dayjs_1 = tslib_1.__importDefault(require(\"dayjs\"));\nconst inversify_1 = require(\"inversify\");\nconst symbols_1 = require(\"../../symbols\");\nconst featureToggleService_1 = require(\"../../utils/featureToggleService\");\nclass ValidationError extends Error {\n}\nexports.ValidationError = ValidationError;\nclass MultipleClaimsNotAllowedError extends ValidationError {\n}\nexports.MultipleClaimsNotAllowedError = MultipleClaimsNotAllowedError;\nclass TooManyManualClaimsError extends ValidationError {\n}\nexports.TooManyManualClaimsError = TooManyManualClaimsError;\nlet SleepDataValidator = class SleepDataValidator {\n    constructor(timeService, featureToggleService, sleepEntity) {\n        this.timeService = timeService;\n        this.featureToggleService = featureToggleService;\n        this.sleepEntity = sleepEntity;\n    }\n    validateSleepEvent(sleepData) {\n        const now = this.timeService.now();\n        const nowInTz = (0, dayjs_1.default)(now).add(sleepData.tzOffsetSeconds, \"seconds\");\n        const wakeUpInTz = (0, dayjs_1.default)(sleepData.wakeUp).add(sleepData.tzOffsetSeconds, \"seconds\");\n        const goToBedInTz = (0, dayjs_1.default)(sleepData.goToBed).add(sleepData.tzOffsetSeconds, \"seconds\");\n        // wake up date should be after go to bed date\n        if (wakeUpInTz.isBefore(goToBedInTz)) {\n            throw new ValidationError(\"error.something_went_wrong\");\n        }\n        // wake up date should be in the past\n        if (wakeUpInTz.isAfter(nowInTz)) {\n            throw new ValidationError(\"error.something_went_wrong\");\n        }\n        // wake up date and now should be in the same day\n        if (!wakeUpInTz.isSame(nowInTz, \"day\")) {\n            throw new ValidationError(\"error.something_went_wrong\");\n        }\n        this.validateMultiClaim(sleepData);\n    }\n    validateClaimEvent(sleepData) {\n        this.validateMultiClaim(sleepData);\n    }\n    validateManualEvent(sleepData) {\n        this.validateMultiClaim(sleepData);\n    }\n    validateMultiClaim(sleepData) {\n        var _a;\n        const isMultiClaimEnabled = (_a = this.featureToggleService.getFeatureValue(featureToggleService_1.FeatureFlags.allowMultipleClaims)) !== null && _a !== void 0 ? _a : false;\n        if (!isMultiClaimEnabled && this.sleepEntity.isAlreadyClaimedToday(sleepData.tzOffsetSeconds)) {\n            throw new MultipleClaimsNotAllowedError(\"error.claim_tokens.cant_claim_tokens_several_times_a_day\");\n        }\n    }\n};\nexports.SleepDataValidator = SleepDataValidator;\nexports.SleepDataValidator = SleepDataValidator = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.ITimeService)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.IFeatureToggleService)),\n    tslib_1.__param(2, (0, inversify_1.inject)(symbols_1.Symbols.ISleepEntity))\n], SleepDataValidator);\n\n},{\"../../symbols\":351,\"../../utils/featureToggleService\":359,\"dayjs\":250,\"inversify\":278,\"tslib\":315}],346:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SleepDeltasCalculator = void 0;\nconst tslib_1 = require(\"tslib\");\nconst dayjs_1 = tslib_1.__importDefault(require(\"dayjs\"));\nconst inversify_1 = require(\"inversify\");\nconst symbols_1 = require(\"../../symbols\");\nconst DATE_FORMATS = [\"HHmm\", \"Hmm\"];\nlet SleepDeltasCalculator = class SleepDeltasCalculator {\n    constructor(timeService) {\n        this.timeService = timeService;\n    }\n    getSleepDeltas(sleep, sleepData) {\n        const goToBedDelta = this.getGoToBedDelta(sleep, sleepData);\n        const wakeUpDelta = this.getWakeUpDelta(sleep, sleepData);\n        return { wakeUpDelta, goToBedDelta };\n    }\n    getSleepDutation(goToBed, wakeUp) {\n        return this.getDurationFromSleepSchedule(this.parseSleepScheduleComponent(goToBed), this.parseSleepScheduleComponent(wakeUp), \"seconds\");\n    }\n    getWakeUpDelta(sleep, sleepData) {\n        const { wakeUp } = sleep.sleepSchedule;\n        const actualWakeUpLocalDate = (0, dayjs_1.default)(sleepData.wakeUp).add(sleepData.tzOffsetSeconds, \"seconds\");\n        const goalWakeUpLocalDate = (0, dayjs_1.default)(this.parseSleepScheduleComponent(wakeUp))\n            .year(actualWakeUpLocalDate.year())\n            .month(actualWakeUpLocalDate.month())\n            .date(actualWakeUpLocalDate.date());\n        return (0, dayjs_1.default)(actualWakeUpLocalDate).diff((0, dayjs_1.default)(goalWakeUpLocalDate), \"seconds\") / 60;\n    }\n    getGoToBedDelta(sleep, sleepData) {\n        const { goToBed, wakeUp } = sleep.sleepSchedule;\n        const actualGoToBedLocalDate = (0, dayjs_1.default)(sleepData.goToBed).add(sleepData.tzOffsetSeconds, \"seconds\");\n        const actualWakeUpLocalDate = (0, dayjs_1.default)(sleepData.wakeUp).add(sleepData.tzOffsetSeconds, \"seconds\");\n        const goalWakeUpLocalDate = (0, dayjs_1.default)(this.parseSleepScheduleComponent(wakeUp))\n            .year(actualWakeUpLocalDate.year())\n            .month(actualWakeUpLocalDate.month())\n            .date(actualWakeUpLocalDate.date());\n        const goalSleepDuration = this.getSleepDutation(goToBed, wakeUp);\n        const goalGoToBedLocalDate = (0, dayjs_1.default)(goalWakeUpLocalDate).add(-goalSleepDuration, \"seconds\");\n        return (0, dayjs_1.default)(actualGoToBedLocalDate).diff((0, dayjs_1.default)(goalGoToBedLocalDate), \"seconds\") / 60;\n    }\n    parseSleepScheduleComponent(component) {\n        const strippedComponent = component.replace(/[^0-9a-zA-Z]/g, \"\").toLowerCase();\n        for (const format of DATE_FORMATS) {\n            const currentDate = (0, dayjs_1.default)(this.timeService.now());\n            const m = (0, dayjs_1.default)(strippedComponent, format);\n            if (m.isValid()) {\n                return m.year(currentDate.year()).month(currentDate.month()).date(currentDate.date()).toDate();\n            }\n        }\n        throw new Error(\"Invalid date format\");\n    }\n    getDurationFromSleepSchedule(goToBedTime, wakeUpTime, unit) {\n        if (wakeUpTime <= goToBedTime) {\n            return (0, dayjs_1.default)(wakeUpTime).add(1, \"days\").diff(goToBedTime, unit);\n        }\n        return (0, dayjs_1.default)(wakeUpTime).diff(goToBedTime, unit);\n    }\n};\nexports.SleepDeltasCalculator = SleepDeltasCalculator;\nexports.SleepDeltasCalculator = SleepDeltasCalculator = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.ITimeService))\n], SleepDeltasCalculator);\n\n},{\"../../symbols\":351,\"dayjs\":250,\"inversify\":278,\"tslib\":315}],347:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SleepEventPayloadBuilder = void 0;\nconst tslib_1 = require(\"tslib\");\nconst dayjs_1 = tslib_1.__importDefault(require(\"dayjs\"));\nconst utc_1 = tslib_1.__importDefault(require(\"dayjs/plugin/utc\"));\nconst inversify_1 = require(\"inversify\");\nconst symbols_1 = require(\"../../symbols\");\ndayjs_1.default.extend(utc_1.default);\nlet SleepEventPayloadBuilder = class SleepEventPayloadBuilder {\n    constructor(sleepDeltasCalculator, sleepEntity) {\n        this.sleepDeltasCalculator = sleepDeltasCalculator;\n        this.sleepEntity = sleepEntity;\n    }\n    buildSleepEventPayload(sleepData, { goToBedDelta, wakeUpDelta }, sleepBoxLevel, rewards, furniture, stages) {\n        var _a;\n        const { goToBed, wakeUp } = this.sleepEntity.sleepSchedule;\n        const goalSleepDuration = this.sleepDeltasCalculator.getDurationFromSleepSchedule(this.sleepDeltasCalculator.parseSleepScheduleComponent(goToBed), this.sleepDeltasCalculator.parseSleepScheduleComponent(wakeUp), \"minutes\");\n        return {\n            actualSleepDuration: sleepData.sleepDuration,\n            rewards,\n            furniture,\n            goalSleepDuration,\n            goToBedGoal: goToBed,\n            wakeUpGoal: wakeUp,\n            sourceType: sleepData.sourceType,\n            sourceId: sleepData.sourceId,\n            goToBedDelta,\n            wakeUpDelta,\n            sleepBoxLevel,\n            sleepDay: (0, dayjs_1.default)(sleepData.wakeUp)\n                .utcOffset(sleepData.tzOffsetSeconds / 60)\n                .format(\"YYYY-MM-DD\"),\n            tzOffsetSeconds: sleepData.tzOffsetSeconds,\n            survey: (_a = sleepData.survey) !== null && _a !== void 0 ? _a : {},\n            daysWithManualData: 0,\n            stages,\n        };\n    }\n    buildClaimOnlySleepEventPayload(sleepData, sleepBoxLevel, rewards, furniture, stages) {\n        var _a;\n        const lastClaimResult = this.sleepEntity.lastClaimResult;\n        const daysWithManualData = (_a = lastClaimResult === null || lastClaimResult === void 0 ? void 0 : lastClaimResult.daysWithManualData) !== null && _a !== void 0 ? _a : 0;\n        return {\n            sleepBoxLevel,\n            rewards,\n            furniture,\n            sleepDay: (0, dayjs_1.default)(sleepData.wakeUp)\n                .utcOffset(sleepData.tzOffsetSeconds / 60)\n                .format(\"YYYY-MM-DD\"),\n            tzOffsetSeconds: sleepData.tzOffsetSeconds,\n            survey: sleepData.survey,\n            daysWithManualData,\n            stages,\n        };\n    }\n    buildManualSleepEventPayload(sleepData, deltas, sleepBoxLevel, rewards, furniture, stages) {\n        var _a;\n        const _b = this.buildSleepEventPayload(sleepData, deltas, sleepBoxLevel, rewards, furniture, stages), { sourceId, sourceType } = _b, rest = tslib_1.__rest(_b, [\"sourceId\", \"sourceType\"]);\n        const lastClaimResult = this.sleepEntity.lastClaimResult;\n        const daysWithManualData = ((_a = lastClaimResult === null || lastClaimResult === void 0 ? void 0 : lastClaimResult.daysWithManualData) !== null && _a !== void 0 ? _a : 0) + 1;\n        return Object.assign(Object.assign({}, rest), { daysWithManualData,\n            stages });\n    }\n};\nexports.SleepEventPayloadBuilder = SleepEventPayloadBuilder;\nexports.SleepEventPayloadBuilder = SleepEventPayloadBuilder = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.ISleepDeltasCalculator)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.ISleepEntity))\n], SleepEventPayloadBuilder);\n\n},{\"../../symbols\":351,\"dayjs\":250,\"dayjs/plugin/utc\":253,\"inversify\":278,\"tslib\":315}],348:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SleepService = void 0;\nconst tslib_1 = require(\"tslib\");\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\n/** @module definitions */\nconst symbols_1 = require(\"../../symbols\");\nconst inversify_1 = require(\"inversify\");\nconst types_1 = require(\"../../../types\");\nconst types_2 = require(\"./types\");\nconst types_3 = require(\"../../types\");\nconst dayjs_1 = tslib_1.__importDefault(require(\"dayjs\"));\nconst sleepDataValidator_1 = require(\"./sleepDataValidator\");\nconst MIN_SLEEP_DURATION_HOURS = 1;\nconst MAX_SLEEP_DURATION_HOURS = 24;\nconst MIN_GO_TO_BED_HOUR = 0;\nconst MAX_GO_TO_BED_HOUR = 24;\nconst SLEEP_REWARD_PACKS = {\n    [types_3.SleepQuality.noData]: \"sleepReward1\",\n    [types_3.SleepQuality.payAttention]: \"sleepReward1\",\n    [types_3.SleepQuality.fair]: \"sleepReward2\",\n    [types_3.SleepQuality.good]: \"sleepReward3\",\n    [types_3.SleepQuality.perfect]: \"sleepReward4\",\n};\nlet SleepService = class SleepService {\n    constructor(sleepEntity, rawSleepDataTransformer, sleepDataValidator, timeService, sleepBonusCalculator, sleepDeltasCalculator, sleepEventPayloadBuilder, rewardsGenerator, rewardManager, streakService, narrativeService, configManager, playerEntity, inventoryEntity) {\n        this.sleepEntity = sleepEntity;\n        this.rawSleepDataTransformer = rawSleepDataTransformer;\n        this.sleepDataValidator = sleepDataValidator;\n        this.timeService = timeService;\n        this.sleepBonusCalculator = sleepBonusCalculator;\n        this.sleepDeltasCalculator = sleepDeltasCalculator;\n        this.sleepEventPayloadBuilder = sleepEventPayloadBuilder;\n        this.rewardsGenerator = rewardsGenerator;\n        this.rewardManager = rewardManager;\n        this.streakService = streakService;\n        this.narrativeService = narrativeService;\n        this.configManager = configManager;\n        this.playerEntity = playerEntity;\n        this.inventoryEntity = inventoryEntity;\n    }\n    getFullSleepInfo() {\n        return {\n            sleepSchedule: this.sleepEntity.sleepSchedule,\n            nextDaySleepSchedule: this.sleepEntity.nextDaySleepSchedule,\n            sleepEvents: this.sleepEntity.sleepEvents,\n            sleepScheduleUnset: this.sleepEntity.sleepScheduleUnset,\n            streak: this.sleepEntity.streak,\n            lastClaimedAt: this.sleepEntity.lastClaimedAt,\n            lastClaimResult: this.sleepEntity.lastClaimResult,\n            lastClaimTzOffsetSeconds: this.sleepEntity.lastClaimTzOffsetSeconds,\n            lastSleepInfo: this.sleepEntity.lastSleepInfo,\n        };\n    }\n    updateSleepSchedule({ goToBed, wakeUp, }) {\n        const goToBedDate = this.sleepDeltasCalculator.parseSleepScheduleComponent(goToBed);\n        const wakeUpDate = this.sleepDeltasCalculator.parseSleepScheduleComponent(wakeUp);\n        const targetDuration = this.sleepDeltasCalculator.getDurationFromSleepSchedule(goToBedDate, wakeUpDate, \"seconds\");\n        const goToBedHour = (0, dayjs_1.default)(goToBedDate).hour() + (0, dayjs_1.default)(goToBedDate).minute() / 60;\n        if (goToBedHour > MAX_GO_TO_BED_HOUR && goToBedHour < MIN_GO_TO_BED_HOUR) {\n            return {\n                error: true,\n                key: types_3.ErrorKey.ValidationError,\n                details: `Go to bed hour must after ${MIN_GO_TO_BED_HOUR} and before ${MAX_GO_TO_BED_HOUR}`,\n            };\n        }\n        if (targetDuration < MIN_SLEEP_DURATION_HOURS * 3600) {\n            return {\n                error: true,\n                key: types_3.ErrorKey.ValidationError,\n                details: `Sleep duration must be at least ${MIN_SLEEP_DURATION_HOURS} hours`,\n            };\n        }\n        if (targetDuration > MAX_SLEEP_DURATION_HOURS * 3600) {\n            return {\n                error: true,\n                key: types_3.ErrorKey.ValidationError,\n                details: `Sleep duration must be less than ${MAX_SLEEP_DURATION_HOURS} hours`,\n            };\n        }\n        const sleepSchedule = {\n            goToBed: (0, dayjs_1.default)(goToBedDate).format(\"HH:mm\"),\n            wakeUp: (0, dayjs_1.default)(wakeUpDate).format(\"HH:mm\"),\n        };\n        if (this.sleepEntity.sleepScheduleUnset) {\n            this.sleepEntity.setSleepSchedule(sleepSchedule);\n        }\n        else {\n            this.sleepEntity.setNextDaySleepSchedule(sleepSchedule);\n        }\n        return {\n            sleepSchedule: this.sleepEntity.sleepSchedule,\n            nextDaySleepSchedule: this.sleepEntity.nextDaySleepSchedule,\n        };\n    }\n    claimFurniture(furnitureId) {\n        var _a, _b, _c;\n        const isTargetFurniture = (item) => item.payload.furnitureId === furnitureId &&\n            item.payload.isSelectable === true &&\n            item.payload.isClaimed === false;\n        const furnitureIndex = (_c = (_b = (_a = this.sleepEntity.lastClaimResult) === null || _a === void 0 ? void 0 : _a.furniture) === null || _b === void 0 ? void 0 : _b.findIndex(isTargetFurniture)) !== null && _c !== void 0 ? _c : -1;\n        if (furnitureIndex === -1) {\n            return {\n                error: true,\n                key: types_3.ErrorKey.ValidationError,\n                details: \"furniture not found or already claimed\",\n            };\n        }\n        const furnitureReward = Object.assign({}, this.sleepEntity.lastClaimResult.furniture[furnitureIndex]);\n        this.rewardManager.applyReward(furnitureReward);\n        // mark the furniture as claimed\n        this.sleepEntity.lastClaimResult.furniture[furnitureIndex] = Object.assign(Object.assign({}, furnitureReward), { payload: Object.assign(Object.assign({}, furnitureReward.payload), { isClaimed: true }) });\n        return { success: true };\n    }\n    claimSheep(rawSleepData) {\n        if (!types_2.ClaimSheepParamsGuard.guard(rawSleepData)) {\n            return {\n                error: true,\n                key: types_3.ErrorKey.ValidationError,\n                details: types_2.ClaimSheepParamsGuard.errors(rawSleepData),\n            };\n        }\n        const claimSheepParams = rawSleepData;\n        let sleepData = this.rawSleepDataTransformer.transform(claimSheepParams);\n        const sleepDay = (0, dayjs_1.default)(this.timeService.now()).add(sleepData.tzOffsetSeconds, \"seconds\").startOf(\"day\").toDate();\n        const { rewards: streakRewards, streak } = this.streakService.processTodaySleepEvent(sleepDay);\n        const flags = this.getFlags(sleepData);\n        const { isClaimOnly, isManual } = flags;\n        try {\n            this.validate(sleepData, { isClaimOnly, isManual });\n        }\n        catch (err) {\n            if (err instanceof sleepDataValidator_1.MultipleClaimsNotAllowedError || err instanceof sleepDataValidator_1.TooManyManualClaimsError) {\n                return {\n                    error: true,\n                    key: types_3.ErrorKey.ValidationError,\n                    details: err.message,\n                };\n            }\n            else if (err instanceof sleepDataValidator_1.ValidationError) {\n                sleepData = this.rawSleepDataTransformer.getEmptySleepData(claimSheepParams);\n            }\n            else {\n                throw err;\n            }\n        }\n        const executionResult = this.regularStrategy(isClaimOnly, sleepData);\n        // the call below stores the generated furniture set in sleepEntity.lastClaimResult, to be used when claiming the selected item:\n        this.addSleepEvent(executionResult.sleepBox.level, executionResult.rewards, executionResult.furniture, sleepData, {\n            isClaimOnly,\n            isManual,\n        });\n        const sleepInfo = this.getSleepInfo(sleepData, isClaimOnly);\n        this.sleepEntity.setLastSleepInfo(sleepInfo);\n        if (this.sleepEntity.nextDaySleepSchedule != null) {\n            this.sleepEntity.applyNextDaySleepSchedule();\n        }\n        return {\n            sleepBox: {\n                content: this.addSleepBox(executionResult.sleepBox),\n                level: executionResult.sleepBox.level,\n            },\n            rewards: executionResult.rewards.map((item) => this.rewardManager.applyReward(item)),\n            furniture: executionResult.furniture,\n            streakRewards: streakRewards.map((item) => this.rewardManager.applyReward(item)),\n            streak,\n            sleepInfo,\n            streakFreezeGemCost: this.getStreakFreezeCost(),\n        };\n    }\n    preClaimSheep(rawSleepData) {\n        if (!types_2.ClaimSheepParamsGuard.guard(rawSleepData)) {\n            return {\n                error: true,\n                key: types_3.ErrorKey.ValidationError,\n                details: types_2.ClaimSheepParamsGuard.errors(rawSleepData),\n            };\n        }\n        const claimSheepParams = rawSleepData;\n        let sleepData = this.rawSleepDataTransformer.transform(claimSheepParams);\n        const flags = this.getFlags(sleepData);\n        const { isClaimOnly, isManual } = flags;\n        try {\n            this.validate(sleepData, { isClaimOnly, isManual });\n        }\n        catch (err) {\n            if (err instanceof sleepDataValidator_1.TooManyManualClaimsError) {\n                return {\n                    error: true,\n                    key: types_3.ErrorKey.ValidationError,\n                    details: err.message,\n                };\n            }\n            else if (err instanceof sleepDataValidator_1.MultipleClaimsNotAllowedError) {\n                return Object.assign(Object.assign({}, this.getTodaySleepResults()), this.getTodayExtra());\n            }\n            else if (err instanceof sleepDataValidator_1.ValidationError) {\n                sleepData = this.rawSleepDataTransformer.getEmptySleepData(claimSheepParams);\n            }\n            else {\n                throw err;\n            }\n        }\n        const executionResult = this.regularStrategy(isClaimOnly, sleepData);\n        const extra = this.getExtra(sleepData, isClaimOnly);\n        return Object.assign(Object.assign({}, executionResult), extra);\n    }\n    buyStreakFreeze(amount) {\n        const cost = this.getStreakFreezeCost();\n        const gemsToSpend = Math.ceil(amount * cost);\n        if (!this.playerEntity.hasGems(gemsToSpend)) {\n            return {\n                error: true,\n                key: types_3.ErrorKey.ValidationError,\n                details: \"not enough gems\",\n            };\n        }\n        this.playerEntity.spendGems(gemsToSpend);\n        this.inventoryEntity.addResource({ resourceType: types_1.ResourceType.streakFreeze }, amount);\n    }\n    restoreStreak() {\n        return this.streakService.restore();\n    }\n    testMoveLastStreakClaim(days = 1) {\n        this.streakService.testMoveLastStreakClaim(days);\n        return this.sleepEntity.streak;\n    }\n    testAssignStreak(days) {\n        this.streakService.testAssignStreak(days);\n        return this.sleepEntity.streak;\n    }\n    getStreakFreezeCost() {\n        return this.configManager.getConfig(\"base\").shopConfig.streakFreezeGemCost;\n    }\n    testMoveSleepDayBack(days = 1) {\n        var _a;\n        if (this.sleepEntity.lastClaimedAt != null) {\n            this.sleepEntity.setLastClaimedAt((0, dayjs_1.default)(this.sleepEntity.lastClaimedAt).subtract(1, \"D\").toISOString());\n        }\n        if (this.sleepEntity.streak.lastStreakDay != null) {\n            this.testMoveLastStreakClaim(days);\n        }\n        return this.sleepEntity.getWeekSleepData((_a = this.sleepEntity.lastClaimTzOffsetSeconds) !== null && _a !== void 0 ? _a : 0);\n    }\n    testSleep(quality) {\n        var _a;\n        this.testMoveSleepDayBack(1);\n        let delta;\n        switch (quality) {\n            case types_3.SleepQuality.perfect:\n                delta = 0;\n                break;\n            case types_3.SleepQuality.good:\n                delta = 30;\n                break;\n            case types_3.SleepQuality.fair:\n                delta = 70;\n                break;\n            case types_3.SleepQuality.payAttention:\n                delta = 100;\n                break;\n            default:\n                delta = 0;\n        }\n        const parsedGoToBedDate = this.sleepDeltasCalculator.parseSleepScheduleComponent(this.sleepEntity.sleepSchedule.goToBed);\n        const parsedWakeUpDate = this.sleepDeltasCalculator.parseSleepScheduleComponent(this.sleepEntity.sleepSchedule.wakeUp);\n        return this.claimSheep({\n            isManual: true,\n            tzOffsetSeconds: (_a = this.sleepEntity.lastClaimTzOffsetSeconds) !== null && _a !== void 0 ? _a : 0,\n            rawSourceData: {\n                goToBed: (0, dayjs_1.default)(parsedGoToBedDate).add(delta, \"m\").format(\"HH:mm\"),\n                wakeUp: (0, dayjs_1.default)(parsedWakeUpDate).add(delta, \"m\").format(\"HH:mm\"),\n            },\n        });\n    }\n    regularStrategy(isClaimOnly, sleepData) {\n        let sleepQuality;\n        let sleepPoints;\n        if (!isClaimOnly) {\n            const { goToBedDelta, wakeUpDelta } = this.sleepDeltasCalculator.getSleepDeltas(this.sleepEntity, sleepData);\n            const durationDelta = -goToBedDelta + wakeUpDelta;\n            sleepQuality = this.sleepBonusCalculator.getSleepQuality(goToBedDelta, durationDelta, sleepData.sleepDuration);\n            sleepPoints = this.sleepBonusCalculator.getSleepPoints(goToBedDelta, durationDelta, sleepData.sleepDuration, sleepQuality);\n        }\n        else {\n            sleepQuality = types_3.SleepQuality.noData;\n            sleepPoints = 40;\n        }\n        const sleepBox = this.rewardsGenerator.generateSleepReward(sleepQuality, sleepPoints);\n        const furniture = this.rewardsGenerator.generateDinoRoomRewardSet(sleepQuality);\n        const rewards = this.rewardsGenerator.generatePackRewards(SLEEP_REWARD_PACKS[sleepQuality]);\n        // TODO: Uncomment when vSleep is back, for now we disabled it\n        // add a vSleep reward by converting sleep points 1:1\n        // rewards.push({\n        //   type: ResourceType.vSleep,\n        //   variant: {\n        //     amount: sleepPoints,\n        //   },\n        // });\n        return {\n            sleepQuality,\n            sleepBox,\n            rewards,\n            furniture,\n        };\n    }\n    getFlags(sleepData) {\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison\n        const isManual = sleepData.sourceType === types_3.SleepClaimType.manual;\n        const isClaimOnly = sleepData.sleepDuration === 0;\n        const isZeroClaim = this.sleepEntity.lastClaimedAt == null;\n        return { isManual, isClaimOnly, isZeroClaim };\n    }\n    validate(sleepData, { isClaimOnly, isManual }) {\n        if (isManual) {\n            this.sleepDataValidator.validateManualEvent(sleepData);\n        }\n        else if (isClaimOnly) {\n            this.sleepDataValidator.validateClaimEvent(sleepData);\n        }\n        else {\n            this.sleepDataValidator.validateSleepEvent(sleepData);\n        }\n    }\n    addSleepEvent(sleepBoxLevel, rewards, furniture, sleepData, { isClaimOnly, isManual }) {\n        let event;\n        if (isManual) {\n            const { goToBedDelta, wakeUpDelta } = this.sleepDeltasCalculator.getSleepDeltas(this.sleepEntity, sleepData);\n            event = {\n                eventType: types_3.SleepClaimType.manual,\n                payload: this.sleepEventPayloadBuilder.buildManualSleepEventPayload(sleepData, { goToBedDelta, wakeUpDelta }, sleepBoxLevel, rewards, furniture, sleepData.stages),\n            };\n        }\n        else if (isClaimOnly) {\n            event = {\n                eventType: types_3.SleepClaimType.claimOnly,\n                payload: this.sleepEventPayloadBuilder.buildClaimOnlySleepEventPayload(sleepData, sleepBoxLevel, rewards, furniture, sleepData.stages),\n            };\n        }\n        else {\n            const { goToBedDelta, wakeUpDelta } = this.sleepDeltasCalculator.getSleepDeltas(this.sleepEntity, sleepData);\n            event = {\n                eventType: types_3.SleepClaimType.regular,\n                payload: this.sleepEventPayloadBuilder.buildSleepEventPayload(sleepData, { goToBedDelta, wakeUpDelta }, sleepBoxLevel, rewards, furniture, sleepData.stages),\n            };\n        }\n        this.sleepEntity.addSleepEvent(event);\n        return event.payload;\n    }\n    addSleepBox(sleepBox) {\n        return this.rewardsGenerator\n            .generateSleepBoxContent(sleepBox.level)\n            .map((item) => this.rewardManager.applyReward(item));\n    }\n    getSleepInfo(sleepData, isClaimOnly) {\n        var _a, _b;\n        if (isClaimOnly) {\n            return {\n                quality: types_3.SleepQuality.noData,\n                sleepPoints: 0,\n                survey: (_a = sleepData.survey) !== null && _a !== void 0 ? _a : {},\n                narrative: this.narrativeService.getNarrativeForSleep(types_3.SleepQuality.noData, []),\n                stages: [],\n            };\n        }\n        const { goToBedDelta, wakeUpDelta } = this.sleepDeltasCalculator.getSleepDeltas(this.sleepEntity, sleepData);\n        const { sleepDuration } = sleepData;\n        const durationDelta = -goToBedDelta + wakeUpDelta;\n        const quality = this.sleepBonusCalculator.getSleepQuality(goToBedDelta, durationDelta, sleepDuration);\n        const sleepImprovements = this.sleepBonusCalculator.getSleepImprovements(goToBedDelta, durationDelta, sleepDuration);\n        return {\n            duration: Math.round(sleepData.sleepDuration),\n            quality,\n            sleepPoints: this.sleepBonusCalculator.getSleepPoints(goToBedDelta, durationDelta, sleepDuration, quality),\n            goToBedDelta: Math.round(goToBedDelta),\n            wakeUpDelta: Math.round(wakeUpDelta),\n            survey: (_b = sleepData.survey) !== null && _b !== void 0 ? _b : {},\n            narrative: this.narrativeService.getNarrativeForSleep(quality, sleepImprovements),\n            stages: sleepData.stages,\n        };\n    }\n    getTodaySleepResults() {\n        const lastClaimResult = this.sleepEntity.lastClaimResult;\n        if (lastClaimResult == null) {\n            throw new Error(\"Last claim result is empty\");\n        }\n        return lastClaimResult;\n    }\n    getTodayExtra() {\n        var _a, _b, _c;\n        return {\n            sleepInfo: this.sleepEntity.lastSleepInfo,\n            weekSleepData: this.sleepEntity.getWeekSleepData((_a = this.sleepEntity.lastClaimTzOffsetSeconds) !== null && _a !== void 0 ? _a : 0),\n            daysWithManualData: (_c = (_b = this.sleepEntity.lastClaimResult) === null || _b === void 0 ? void 0 : _b.daysWithManualData) !== null && _c !== void 0 ? _c : 0,\n            streak: this.sleepEntity.streak,\n        };\n    }\n    getExtra(sleepData, isClaimOnly) {\n        var _a, _b, _c, _d;\n        let sleepInfo;\n        if (isClaimOnly) {\n            sleepInfo = {\n                quality: types_3.SleepQuality.noData,\n                sleepPoints: 0,\n                survey: (_a = sleepData.survey) !== null && _a !== void 0 ? _a : {},\n                narrative: this.narrativeService.getNarrativeForSleep(types_3.SleepQuality.noData, []),\n                stages: [],\n            };\n        }\n        else {\n            const { goToBedDelta, wakeUpDelta } = this.sleepDeltasCalculator.getSleepDeltas(this.sleepEntity, sleepData);\n            const { sleepDuration } = sleepData;\n            const durationDelta = -goToBedDelta + wakeUpDelta;\n            const quality = this.sleepBonusCalculator.getSleepQuality(goToBedDelta, durationDelta, sleepDuration);\n            const sleepImprovements = this.sleepBonusCalculator.getSleepImprovements(goToBedDelta, durationDelta, sleepDuration);\n            sleepInfo = {\n                quality,\n                sleepPoints: this.sleepBonusCalculator.getSleepPoints(goToBedDelta, durationDelta, sleepDuration, quality),\n                duration: Math.round(sleepDuration),\n                goToBedDelta: Math.round(goToBedDelta),\n                wakeUpDelta: Math.round(wakeUpDelta),\n                survey: (_b = sleepData.survey) !== null && _b !== void 0 ? _b : {},\n                narrative: this.narrativeService.getNarrativeForSleep(quality, sleepImprovements),\n                stages: sleepData.stages,\n            };\n        }\n        const weekSleepData = this.sleepEntity.getWeekSleepData(sleepData.tzOffsetSeconds);\n        const todayNumSundayWeek = this.getTodayWeekDayNumber(sleepData.tzOffsetSeconds);\n        const todayNumMondayWeek = todayNumSundayWeek === 0 ? 7 : todayNumSundayWeek;\n        const todayIdMondayWeek = weekSleepData.mondayWeek.findIndex((el) => el.weekDay === todayNumMondayWeek);\n        const todayIdSundayWeek = weekSleepData.sundayWeek.findIndex((el) => el.weekDay === todayNumSundayWeek);\n        if (sleepInfo.quality !== types_3.SleepQuality.noData) {\n            const { wakeUp: wakeUpGoal, goToBed: goToBedGoal } = this.sleepEntity.sleepSchedule;\n            weekSleepData.mondayWeek[todayIdMondayWeek] = {\n                quality: sleepInfo.quality,\n                duration: sleepInfo.duration,\n                goToBedDelta: sleepInfo.goToBedDelta,\n                wakeUpDelta: sleepInfo.wakeUpDelta,\n                goToBedGoal,\n                wakeUpGoal,\n                weekDay: todayNumMondayWeek,\n            };\n            weekSleepData.sundayWeek[todayIdSundayWeek] = {\n                quality: sleepInfo.quality,\n                duration: sleepInfo.duration,\n                goToBedDelta: sleepInfo.goToBedDelta,\n                wakeUpDelta: sleepInfo.wakeUpDelta,\n                goToBedGoal,\n                wakeUpGoal,\n                weekDay: todayNumSundayWeek,\n            };\n        }\n        return {\n            sleepInfo,\n            weekSleepData,\n            daysWithManualData: (_d = (_c = this.sleepEntity.lastClaimResult) === null || _c === void 0 ? void 0 : _c.daysWithManualData) !== null && _d !== void 0 ? _d : 0,\n            streak: this.sleepEntity.streak,\n        };\n    }\n    getTodayWeekDayNumber(tzOffsetSeconds) {\n        return (0, dayjs_1.default)(this.timeService.getDate()).add(tzOffsetSeconds, \"seconds\").day();\n    }\n    /** @public */\n    preClaimSleep(params) {\n        const { rawSourceData, sourceId, noData = false } = params;\n        const sleepData = {\n            tzOffsetSeconds: 0,\n            sleepDuration: rawSourceData.sleepDuration,\n            survey: {},\n            stages: [],\n            sourceType: types_3.SleepClaimType.regular,\n            goToBed: new Date(rawSourceData.goToBed),\n            wakeUp: new Date(rawSourceData.wakeUp),\n            sourceId,\n        };\n        if (noData || sleepData.sleepDuration < 4 * 60) {\n            sleepData.sleepDuration = 0;\n            sleepData.sourceType = types_3.SleepClaimType.claimOnly;\n        }\n        const isClaimOnly = sleepData.sleepDuration === 0;\n        const { sleepBox, rewards } = this.regularStrategy(isClaimOnly, sleepData);\n        // preview only without adding to the entity\n        const previewContent = this.rewardsGenerator.generateSleepBoxContent(sleepBox.level);\n        const extra = this.getExtra(sleepData, isClaimOnly);\n        return Object.assign({ sleepBox: { level: sleepBox.level, content: previewContent }, rewards }, extra);\n    }\n    /** @public */\n    claimSleep(params) {\n        const { rawSourceData, sourceId, noData = false } = params;\n        let sleepData = {\n            tzOffsetSeconds: 0,\n            sleepDuration: rawSourceData.sleepDuration,\n            survey: {},\n            stages: [],\n            sourceType: types_3.SleepClaimType.regular,\n            goToBed: new Date(rawSourceData.goToBed),\n            wakeUp: new Date(rawSourceData.wakeUp),\n            sourceId,\n        };\n        // Force “no data” / claim-only flow if requested or duration less than 4 hours\n        if (noData || sleepData.sleepDuration < 4 * 60) {\n            sleepData.sleepDuration = 0;\n            sleepData.sourceType = types_3.SleepClaimType.claimOnly;\n        }\n        // Derive flags the same way as claimSheep (isManual is always false here)\n        const isClaimOnly = sleepData.sleepDuration === 0;\n        const isManual = false;\n        // —— Validation (parity with claimSheep) ——\n        try {\n            if (isManual) {\n                this.sleepDataValidator.validateManualEvent(sleepData);\n            }\n            else if (isClaimOnly) {\n                this.sleepDataValidator.validateClaimEvent(sleepData);\n            }\n            else {\n                this.sleepDataValidator.validateSleepEvent(sleepData);\n            }\n        }\n        catch (err) {\n            // preserve claimSheep semantics\n            if (err instanceof sleepDataValidator_1.MultipleClaimsNotAllowedError) {\n                return {\n                    error: true,\n                    key: types_3.ErrorKey.ValidationError,\n                    details: err.message,\n                };\n            }\n            else if (err instanceof sleepDataValidator_1.ValidationError) {\n                // fall back to a “no data” preview/claim-only flow\n                sleepData = Object.assign(Object.assign({}, sleepData), { sleepDuration: 0, sourceType: types_3.SleepClaimType.claimOnly, stages: [], survey: {} });\n            }\n            else {\n                throw err;\n            }\n        }\n        // Process streak (same place as in claimSheep)\n        const sleepDay = (0, dayjs_1.default)(this.timeService.now()).add(sleepData.tzOffsetSeconds, \"seconds\").startOf(\"day\").toDate();\n        const { rewards: streakRewards, streak } = this.streakService.processTodaySleepEvent(sleepDay);\n        // Run reward strategy\n        const executionResult = this.regularStrategy(isClaimOnly, sleepData);\n        // Persist event\n        this.addSleepEvent(executionResult.sleepBox.level, executionResult.rewards, executionResult.furniture, sleepData, {\n            isClaimOnly,\n            isManual,\n        });\n        // Record sleepInfo and roll over schedule\n        const sleepInfo = this.getSleepInfo(sleepData, isClaimOnly);\n        this.sleepEntity.setLastSleepInfo(sleepInfo);\n        if (this.sleepEntity.nextDaySleepSchedule != null) {\n            this.sleepEntity.applyNextDaySleepSchedule();\n        }\n        return {\n            sleepBox: {\n                content: this.addSleepBox(executionResult.sleepBox),\n                level: executionResult.sleepBox.level,\n            },\n            rewards: executionResult.rewards.map((r) => this.rewardManager.applyReward(r)),\n            furniture: executionResult.furniture,\n            streakRewards: streakRewards.map((r) => this.rewardManager.applyReward(r)),\n            streak,\n            sleepInfo,\n            streakFreezeGemCost: this.getStreakFreezeCost(),\n        };\n    }\n};\nexports.SleepService = SleepService;\nexports.SleepService = SleepService = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.ISleepEntity)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.IRawSleepDataTransformer)),\n    tslib_1.__param(2, (0, inversify_1.inject)(symbols_1.Symbols.ISleepDataValidator)),\n    tslib_1.__param(3, (0, inversify_1.inject)(symbols_1.Symbols.ITimeService)),\n    tslib_1.__param(4, (0, inversify_1.inject)(symbols_1.Symbols.ISleepBonusCalculator)),\n    tslib_1.__param(5, (0, inversify_1.inject)(symbols_1.Symbols.ISleepDeltasCalculator)),\n    tslib_1.__param(6, (0, inversify_1.inject)(symbols_1.Symbols.ISleepEventPayloadBuilder)),\n    tslib_1.__param(7, (0, inversify_1.inject)(symbols_1.Symbols.IRewardsGenerator)),\n    tslib_1.__param(8, (0, inversify_1.inject)(symbols_1.Symbols.IRewardManager)),\n    tslib_1.__param(9, (0, inversify_1.inject)(symbols_1.Symbols.IStreakService)),\n    tslib_1.__param(10, (0, inversify_1.inject)(symbols_1.Symbols.INarrativeService)),\n    tslib_1.__param(11, (0, inversify_1.inject)(symbols_1.Symbols.IConfigManager)),\n    tslib_1.__param(12, (0, inversify_1.inject)(symbols_1.Symbols.IPlayerEntity)),\n    tslib_1.__param(13, (0, inversify_1.inject)(symbols_1.Symbols.IInventoryEntity))\n], SleepService);\n\n},{\"../../../types\":367,\"../../symbols\":351,\"../../types\":356,\"./sleepDataValidator\":345,\"./types\":350,\"dayjs\":250,\"inversify\":278,\"tslib\":315}],349:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StreakService = void 0;\nconst tslib_1 = require(\"tslib\");\nconst symbols_1 = require(\"../../../symbols\");\nconst dayjs_1 = tslib_1.__importDefault(require(\"dayjs\"));\nconst inversify_1 = require(\"inversify\");\nconst types_1 = require(\"../../../../types\");\nconst types_2 = require(\"../../../types\");\nconst TIMELINE_LENGTH = 6;\nlet StreakService = class StreakService {\n    constructor(sleepEntity, inventoryEntity, configManager, rewardsGenerator) {\n        this.sleepEntity = sleepEntity;\n        this.inventoryEntity = inventoryEntity;\n        this.configManager = configManager;\n        this.rewardsGenerator = rewardsGenerator;\n        this.streakRewards = this.configManager.getConfig(\"base\").streakRewards;\n    }\n    processTodaySleepEvent(sleepDay) {\n        const streakInfo = this.sleepEntity.streak;\n        const lastStreakDay = streakInfo.lastStreakDay != null ? new Date(streakInfo.lastStreakDay) : streakInfo.lastStreakDay;\n        const { currentStreakDays } = streakInfo;\n        const newStreakDays = (currentStreakDays !== null && currentStreakDays !== void 0 ? currentStreakDays : 0) + 1;\n        const rewards = [];\n        if (this.isConsecutiveClaim(sleepDay, lastStreakDay)) {\n            this.sleepEntity.setStreakInfo({\n                currentStreakDays: newStreakDays,\n                streakTimeline: this.updateStreakTimeline(1, 0, sleepDay),\n                frozenDaysInRow: 0,\n                restore: {\n                    availible: false,\n                },\n                lastStreakDay: sleepDay.toISOString(),\n            });\n            const rewardConfig = this.streakRewards.find((el) => el.streakDay === newStreakDays);\n            if (rewardConfig != null) {\n                rewards.push(...this.rewardsGenerator.generatePackRewards(rewardConfig.reward));\n            }\n        }\n        else if (this.isClaimedToday(sleepDay, lastStreakDay)) {\n            this.sleepEntity.setStreakInfo({\n                currentStreakDays: newStreakDays,\n                frozenDaysInRow: 0,\n                streakTimeline: this.updateStreakDayAtDate(sleepDay, currentStreakDays + 1),\n                restore: {\n                    availible: false,\n                },\n                lastStreakDay: sleepDay.toISOString(),\n            });\n            const rewardConfig = this.streakRewards.find((el) => el.streakDay === newStreakDays);\n            if (rewardConfig != null) {\n                rewards.push(...this.rewardsGenerator.generatePackRewards(rewardConfig.reward));\n            }\n        }\n        else {\n            const { frozenDaysInRow, daysToRestore, newStreakTimeline } = this.freezeStreak(sleepDay, lastStreakDay);\n            if (daysToRestore === 0) {\n                this.sleepEntity.setStreakInfo({\n                    lastStreakDay: sleepDay.toISOString(),\n                    currentStreakDays: newStreakDays,\n                    streakTimeline: this.updateStreakTimeline(1, 0, sleepDay, newStreakTimeline),\n                    frozenDaysInRow,\n                    restore: {\n                        availible: false,\n                    },\n                });\n                const rewardConfig = this.streakRewards.find((el) => el.streakDay === newStreakDays);\n                if (rewardConfig != null) {\n                    rewards.push(...this.rewardsGenerator.generatePackRewards(rewardConfig.reward));\n                }\n            }\n            else {\n                this.sleepEntity.setStreakInfo({\n                    lastStreakDay: sleepDay.toISOString(),\n                    v2LastStreakDays: 0,\n                    currentStreakDays: 1,\n                    streakTimeline: this.buildStreakTimeline(1, sleepDay),\n                    frozenDaysInRow: 0,\n                    restore: {\n                        availible: true,\n                        daysToRestore,\n                        frozenDaysInRow,\n                        streakTimeline: this.updateStreakTimeline(1, 0, sleepDay, newStreakTimeline),\n                        currentStreakDays,\n                        v2LastStreakDays: streakInfo.v2LastStreakDays,\n                    },\n                });\n            }\n        }\n        return {\n            streak: this.sleepEntity.streak,\n            rewards,\n        };\n    }\n    restore() {\n        const { restore, lastStreakDay } = this.sleepEntity.streak;\n        const rewards = [];\n        if (!restore.availible) {\n            return {\n                error: true,\n                key: types_2.ErrorKey.ValidationError,\n                details: \"restoration not availible\",\n            };\n        }\n        if (lastStreakDay == null) {\n            throw new Error(\"restoration availible, but no lastStreakDay\");\n        }\n        const { daysToRestore, availible, currentStreakDays } = restore, rest = tslib_1.__rest(restore, [\"daysToRestore\", \"availible\", \"currentStreakDays\"]);\n        if (!this.inventoryEntity.hasResource(types_1.ResourceType.streakFreeze, daysToRestore)) {\n            throw new Error(\"restoration not availible - not enought sreakFreeze\");\n        }\n        this.inventoryEntity.spendResource(types_1.ResourceType.streakFreeze, daysToRestore);\n        const rewardConfig = this.streakRewards.find((el) => el.streakDay === currentStreakDays);\n        if (rewardConfig != null) {\n            rewards.push(...this.rewardsGenerator.generatePackRewards(rewardConfig.reward));\n        }\n        this.sleepEntity.setStreakInfo(Object.assign(Object.assign({}, rest), { currentStreakDays, restore: {\n                availible: false,\n            } }));\n        return {\n            streak: this.sleepEntity.streak,\n            rewards,\n        };\n    }\n    freezeStreak(sleepDay, lastStreakDay) {\n        if (lastStreakDay == null) {\n            throw new Error(\"(lastStreakDay == null) on freezeStreak\");\n        }\n        const daysToFreeze = (0, dayjs_1.default)(sleepDay).diff((0, dayjs_1.default)(lastStreakDay), \"d\") - 1;\n        if (daysToFreeze < 0) {\n            throw new Error(`daysToFreeze < 0; ${daysToFreeze}; sleepDay: ${sleepDay.toISOString()}; lastStreakDay: ${lastStreakDay.toISOString()}`);\n        }\n        if (daysToFreeze === 0) {\n            return { frozenDaysInRow: 0, daysToRestore: 0, newStreakTimeline: this.sleepEntity.streak.streakTimeline };\n        }\n        const newStreakTimeline = this.updateStreakTimeline(0, daysToFreeze, sleepDay);\n        const streakFreeze = this.inventoryEntity.getResource(types_1.ResourceType.streakFreeze);\n        if (streakFreeze == null || streakFreeze.amount === 0) {\n            return { frozenDaysInRow: daysToFreeze, daysToRestore: daysToFreeze, newStreakTimeline };\n        }\n        const daysToRestore = daysToFreeze - Math.min(streakFreeze.amount, daysToFreeze);\n        if (daysToRestore < 0) {\n            throw new Error(`${daysToRestore < 0}; daysToFreeze: ${daysToFreeze};  streakFreeze.amount: ${streakFreeze.amount}`);\n        }\n        this.inventoryEntity.spendResource(types_1.ResourceType.streakFreeze, Math.min(streakFreeze.amount, daysToFreeze));\n        return { frozenDaysInRow: daysToFreeze, daysToRestore, newStreakTimeline };\n    }\n    buildStreakTimeline(streakDay, startDay) {\n        const streakTimeLine = [\n            {\n                date: (0, dayjs_1.default)(startDay).toISOString(),\n                weekday: (0, dayjs_1.default)(startDay).format(\"ddd\").toLowerCase(),\n                frozen: false,\n                streakDay,\n                rewards: [],\n            },\n        ];\n        const firstDayStreakRewardConfig = this.streakRewards.find((el) => el.streakDay === 1);\n        if (firstDayStreakRewardConfig != null) {\n            streakTimeLine[0].rewards = this.rewardsGenerator.generatePackRewards(firstDayStreakRewardConfig.reward);\n        }\n        for (let i = 1; i < TIMELINE_LENGTH; i++) {\n            const date = (0, dayjs_1.default)(startDay).add(i, \"days\");\n            streakTimeLine.push({\n                date: date.toISOString(),\n                weekday: date.format(\"ddd\").toLowerCase(),\n                frozen: false,\n                rewards: [],\n            });\n            const dayStreakRewardConfig = this.streakRewards.find((el) => el.streakDay === 1 + i);\n            if (dayStreakRewardConfig != null) {\n                streakTimeLine[i].rewards = this.rewardsGenerator.generatePackRewards(dayStreakRewardConfig.reward);\n            }\n        }\n        return streakTimeLine;\n    }\n    testMoveLastStreakClaim(days = 1) {\n        const { lastStreakDay } = this.sleepEntity.streak;\n        if (lastStreakDay == null) {\n            throw new Error(\"no claims yet\");\n        }\n        this.sleepEntity.setStreakInfo({\n            lastStreakDay: (0, dayjs_1.default)(lastStreakDay).subtract(days, \"days\").toISOString(),\n            streakTimeline: this.moveTimelineBack(days),\n        });\n    }\n    testAssignStreak(newStreakDays) {\n        var _a;\n        const { lastStreakDay, currentStreakDays } = this.sleepEntity.streak;\n        if (lastStreakDay == null) {\n            throw new Error(\"no claims yet\");\n        }\n        if (currentStreakDays === newStreakDays) {\n            return {\n                streak: this.sleepEntity.streak,\n                rewards: [],\n            };\n        }\n        const sleepDay = (0, dayjs_1.default)()\n            .add((_a = this.sleepEntity.lastClaimTzOffsetSeconds) !== null && _a !== void 0 ? _a : 0, \"seconds\")\n            .startOf(\"day\")\n            .toDate();\n        if (currentStreakDays > newStreakDays) {\n            this.sleepEntity.setStreakInfo({\n                currentStreakDays: newStreakDays,\n                streakTimeline: this.moveTimelineBack(currentStreakDays - newStreakDays),\n            });\n            return {\n                streak: this.sleepEntity.streak,\n                rewards: [],\n            };\n        }\n        else {\n            let rewards = [];\n            const rewardConfigs = this.streakRewards.filter((el) => el.streakDay > currentStreakDays && el.streakDay <= newStreakDays);\n            if (rewardConfigs.length > 0) {\n                rewards = rewardConfigs.flatMap(({ reward }) => this.rewardsGenerator.generatePackRewards(reward));\n            }\n            this.sleepEntity.setStreakInfo({\n                currentStreakDays: newStreakDays,\n                streakTimeline: this.updateStreakTimeline(newStreakDays - currentStreakDays, 0, sleepDay),\n                frozenDaysInRow: 0,\n                restore: {\n                    availible: false,\n                },\n                lastStreakDay: sleepDay.toISOString(),\n            });\n            return {\n                streak: this.sleepEntity.streak,\n                rewards,\n            };\n        }\n    }\n    updateStreakTimeline(streakDaysToAdd, frozenDaysInRow, sleepDay, overrideTimeline) {\n        var _a, _b, _c, _d, _e;\n        const currentTimeline = overrideTimeline !== null && overrideTimeline !== void 0 ? overrideTimeline : this.sleepEntity.streak.streakTimeline;\n        if (currentTimeline.length === 0) {\n            return this.buildStreakTimeline(streakDaysToAdd, sleepDay);\n        }\n        let updatedTimeline = currentTimeline.filter((el) => { var _a; return (_a = (el.streakDay != null || el.frozen)) !== null && _a !== void 0 ? _a : false; });\n        const previousStreakDays = (_b = (_a = updatedTimeline.filter((el) => el.streakDay != null).at(-1)) === null || _a === void 0 ? void 0 : _a.streakDay) !== null && _b !== void 0 ? _b : 0;\n        if (streakDaysToAdd < 0) {\n            throw new Error(`streakDaysToAdd < 0; streakDaysToAdd: ${streakDaysToAdd}; previousStreakDays: ${previousStreakDays}; frozenDaysInRow: ${frozenDaysInRow}`);\n        }\n        const lastStreakDate = (_c = updatedTimeline.at(-1)) === null || _c === void 0 ? void 0 : _c.date;\n        if (lastStreakDate == null) {\n            throw new Error(`unknown lastStreakDate: currentTimeline: ${JSON.stringify(currentTimeline)}`);\n        }\n        for (let i = 1; i <= frozenDaysInRow; i++) {\n            const date = (0, dayjs_1.default)(lastStreakDate).add(i, \"days\");\n            updatedTimeline.push({\n                date: date.toISOString(),\n                weekday: date.format(\"ddd\").toLowerCase(),\n                frozen: true,\n                rewards: [],\n            });\n        }\n        const lastFrozenDate = (_d = updatedTimeline.at(-1)) === null || _d === void 0 ? void 0 : _d.date;\n        for (let i = 1; i <= streakDaysToAdd; i++) {\n            const date = (0, dayjs_1.default)(lastFrozenDate).add(i, \"days\");\n            updatedTimeline.push({\n                date: date.toISOString(),\n                weekday: date.format(\"ddd\").toLowerCase(),\n                frozen: false,\n                streakDay: previousStreakDays + i,\n                rewards: [],\n            });\n            const dayStreakRewardConfig = this.streakRewards.find((el) => el.streakDay === previousStreakDays + i);\n            if (dayStreakRewardConfig != null) {\n                // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n                updatedTimeline.at(-1).rewards = this.rewardsGenerator.generatePackRewards(dayStreakRewardConfig.reward);\n            }\n        }\n        updatedTimeline = updatedTimeline.slice(-(TIMELINE_LENGTH - 1));\n        const emptySlotsToAdd = TIMELINE_LENGTH - updatedTimeline.length;\n        const lastClaimedDate = (_e = updatedTimeline.at(-1)) === null || _e === void 0 ? void 0 : _e.date;\n        if (emptySlotsToAdd > 0) {\n            for (let i = 1; i <= emptySlotsToAdd; i++) {\n                const date = (0, dayjs_1.default)(lastClaimedDate).add(i, \"days\");\n                updatedTimeline.push({\n                    date: date.toISOString(),\n                    weekday: date.format(\"ddd\").toLowerCase(),\n                    frozen: false,\n                    rewards: [],\n                });\n                const dayStreakRewardConfig = this.streakRewards.find((el) => el.streakDay === previousStreakDays + streakDaysToAdd + i);\n                if (dayStreakRewardConfig != null) {\n                    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n                    updatedTimeline.at(-1).rewards = this.rewardsGenerator.generatePackRewards(dayStreakRewardConfig.reward);\n                }\n            }\n        }\n        return updatedTimeline;\n    }\n    isConsecutiveClaim(sleepDay, lastStreakDay) {\n        return lastStreakDay == null || sleepDay.getTime() - lastStreakDay.getTime() === 24 * 3600 * 1000;\n    }\n    isClaimedToday(sleepDay, lastStreakDay) {\n        return lastStreakDay != null && lastStreakDay.getTime() === sleepDay.getTime();\n    }\n    moveTimelineBack(days) {\n        return this.sleepEntity.streak.streakTimeline.map((el) => {\n            const date = (0, dayjs_1.default)(el.date).subtract(days, \"days\");\n            return Object.assign(Object.assign({}, el), { date: date.toISOString(), weekday: date.format(\"ddd\").toLowerCase() });\n        });\n    }\n    assignTimelineLastCLaim(days) {\n        const currentTimeline = this.sleepEntity.streak.streakTimeline;\n        const previousStreakDaysIdx = currentTimeline.filter((el) => el.streakDay != null).length - 1;\n        if (previousStreakDaysIdx == null) {\n            throw new Error(\"previuos claim not found\");\n        }\n        currentTimeline[previousStreakDaysIdx].streakDay = days;\n        return currentTimeline;\n    }\n    updateStreakDayAtDate(date, streakDay) {\n        const updatedTimeline = this.sleepEntity.streak.streakTimeline;\n        const dateIdx = updatedTimeline.findIndex((el) => el.date === date.toISOString());\n        updatedTimeline[dateIdx].streakDay = streakDay;\n        return updatedTimeline;\n    }\n};\nexports.StreakService = StreakService;\nexports.StreakService = StreakService = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.ISleepEntity)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.IInventoryEntity)),\n    tslib_1.__param(2, (0, inversify_1.inject)(symbols_1.Symbols.IConfigManager)),\n    tslib_1.__param(3, (0, inversify_1.inject)(symbols_1.Symbols.IRewardsGenerator))\n], StreakService);\n\n},{\"../../../../types\":367,\"../../../symbols\":351,\"../../../types\":356,\"dayjs\":250,\"inversify\":278,\"tslib\":315}],350:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ParsedClaimSheepAndroidParamsGuard = exports.ParsedClaimSheepAndroidParams = exports.AndroidSleepDataSchemaValidator = exports.ClaimSheepParamsGuard = exports.ClaimSheepManualParamsGuard = exports.ClaimSheepAndroidParamsGuard = exports.ClaimSheepIOSParamsGuard = void 0;\nconst tslib_1 = require(\"tslib\");\n/** @module definitions */\nconst dayjs_1 = tslib_1.__importDefault(require(\"dayjs\"));\nconst typebox_1 = require(\"@sinclair/typebox\");\nconst customParseFormat_1 = tslib_1.__importDefault(require(\"dayjs/plugin/customParseFormat\"));\nconst types_1 = require(\"../../../types\");\nconst schemaValidation_1 = require(\"../../../services/schemaValidation\");\ndayjs_1.default.extend(customParseFormat_1.default);\nconst HHmmRegExp = /^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/;\nconst surveySleepDataSchema = typebox_1.Type.Object({\n    perceivedSleepQuality: typebox_1.Type.Optional(types_1.PerceivedSleepQualitySchema),\n});\nconst manualSleepDataSchema = typebox_1.Type.Object({\n    goToBed: typebox_1.Type.RegExp(HHmmRegExp),\n    wakeUp: typebox_1.Type.RegExp(HHmmRegExp),\n});\nconst AndroidSleepApiSchema = typebox_1.Type.Array(typebox_1.Type.Object({\n    confidence: typebox_1.Type.Number(),\n    light: typebox_1.Type.Number(),\n    motion: typebox_1.Type.Number(),\n    timestampSeconds: typebox_1.Type.Number(),\n}));\nconst AndroidHealthConnectSchema = typebox_1.Type.Array(typebox_1.Type.Object({\n    endTimeEpochMilli: typebox_1.Type.Number(),\n    metadata: typebox_1.Type.Object({\n        clientRecordVersion: typebox_1.Type.Number(),\n        id: typebox_1.Type.String(),\n        lastModifiedTimeEpochMilli: typebox_1.Type.Number(),\n        originPackageName: typebox_1.Type.String(),\n        recordingMethod: typebox_1.Type.Number(),\n    }),\n    stages: typebox_1.Type.Array(typebox_1.Type.Object({\n        endTimeEpochMilli: typebox_1.Type.Number(),\n        stage: typebox_1.Type.Number(),\n        startTimeEpochMilli: typebox_1.Type.Number(),\n    })),\n    startTimeEpochMilli: typebox_1.Type.Number(),\n}));\nconst IOSSleepDataSchema = typebox_1.Type.Array(typebox_1.Type.Object({\n    endDate: typebox_1.Type.Number(),\n    metadata: typebox_1.Type.String(),\n    description: typebox_1.Type.String(),\n    sourceRevision: typebox_1.Type.String(),\n    startDate: typebox_1.Type.Number(),\n}));\nconst ClaimSheepBaseParams = {\n    tzOffsetSeconds: typebox_1.Type.Number(),\n    survey: typebox_1.Type.Optional(surveySleepDataSchema),\n    stages: typebox_1.Type.Optional(types_1.SleepStagesSchema),\n};\nconst ClaimSheepIOSParams = typebox_1.Type.Object(Object.assign(Object.assign({}, ClaimSheepBaseParams), { rawSourceData: IOSSleepDataSchema }));\nexports.ClaimSheepIOSParamsGuard = (0, schemaValidation_1.generateGuard)(ClaimSheepIOSParams);\nconst ClaimSheepAndroidParams = typebox_1.Type.Object(Object.assign(Object.assign({}, ClaimSheepBaseParams), { rawSourceData: typebox_1.Type.String() }));\nexports.ClaimSheepAndroidParamsGuard = (0, schemaValidation_1.generateGuard)(ClaimSheepAndroidParams);\nconst ClaimSheepManualParams = typebox_1.Type.Object(Object.assign(Object.assign({}, ClaimSheepBaseParams), { isManual: typebox_1.Type.Literal(true), rawSourceData: manualSleepDataSchema }));\nexports.ClaimSheepManualParamsGuard = (0, schemaValidation_1.generateGuard)(ClaimSheepManualParams);\nconst ClaimSheepParams = typebox_1.Type.Union([ClaimSheepIOSParams, ClaimSheepAndroidParams, ClaimSheepManualParams]);\nexports.ClaimSheepParamsGuard = (0, schemaValidation_1.generateGuard)(ClaimSheepParams);\nconst AndroidSleepDataSchema = typebox_1.Type.Object({\n    healthConnectData: typebox_1.Type.Optional(typebox_1.Type.Union([AndroidHealthConnectSchema, typebox_1.Type.Null(), typebox_1.Type.Undefined()])),\n    sleepApiData: typebox_1.Type.Optional(typebox_1.Type.Union([AndroidSleepApiSchema, typebox_1.Type.Null(), typebox_1.Type.Undefined()])),\n});\nexports.AndroidSleepDataSchemaValidator = (0, schemaValidation_1.generateValidator)(AndroidSleepDataSchema);\nexports.ParsedClaimSheepAndroidParams = typebox_1.Type.Object({\n    tzOffsetSeconds: typebox_1.Type.Number(),\n    rawSourceData: AndroidSleepDataSchema,\n});\nexports.ParsedClaimSheepAndroidParamsGuard = (0, schemaValidation_1.generateGuard)(exports.ParsedClaimSheepAndroidParams);\n\n},{\"../../../services/schemaValidation\":366,\"../../../types\":367,\"@sinclair/typebox\":37,\"dayjs\":250,\"dayjs/plugin/customParseFormat\":251,\"tslib\":315}],351:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Symbols = void 0;\nexports.Symbols = {\n    ITimeService: Symbol(\"ITimeService\"),\n    IFeatureToggleService: Symbol(\"IFeatureToggleService\"),\n    IRewardsGenerator: Symbol(\"IRewardsGenerator\"),\n    IRandomService: Symbol(\"IRandomService\"),\n    IRNGFactory: Symbol(\"IRNGFactory\"),\n    IHeroConfigRepository: Symbol(\"IHeroConfigRepository\"),\n    IHeroStatsCalculator: Symbol(\"IHeroStatsCalculator\"),\n    IHeroFactory: Symbol(\"IHeroFactory\"),\n    IGameContext: Symbol(\"IGameContext\"),\n    IGameContextState: Symbol(\"IGameContextState\"),\n    IGameContextGlobalState: Symbol(\"IGameContextGlobalState\"),\n    IGameContextInitialState: Symbol(\"IGameContextInitialState\"),\n    IPlayerService: Symbol(\"IPlayerService\"),\n    IBattleService: Symbol(\"IBattleService\"),\n    IRpgUuidGenerator: Symbol(\"IRpgUuidGenerator\"),\n    IInventoryService: Symbol(\"IInventoryService\"),\n    IHeroService: Symbol(\"IHeroService\"),\n    IPathService: Symbol(\"IPathService\"),\n    IPlayerEntity: Symbol(\"PlayerEntity\"),\n    ISleepEntity: Symbol(\"ISleepEntity\"),\n    IEquipmentManager: Symbol(\"EquipmentManager\"),\n    IInventoryEntity: Symbol(\"IInventoryEntity\"),\n    IRewardManager: Symbol(\"IRewardManager\"),\n    IHeroClassManager: Symbol(\"IHeroClassManager\"),\n    IResourceManager: Symbol(\"IResourceManager\"),\n    // runtime\n    Container: Symbol(\"Container\"),\n    RootRNG: Symbol(\"RootRNG\"),\n    InitialGameState: Symbol(\"InitialGameState\"),\n    IConfigValidator: Symbol(\"IConfigValidator\"),\n    IConfigManager: Symbol(\"IConfigManager\"),\n    // sleep\n    IRawSleepDataTransformer: Symbol(\"IRawSleepDataTransformer\"),\n    IStreakService: Symbol(\"IStreakService\"),\n    ISleepDataValidator: Symbol(\"ISleepDataValidator\"),\n    ISleepBonusCalculator: Symbol(\"ISleepBonusCalculator\"),\n    ISleepDeltasCalculator: Symbol(\"ISleepDeltasCalculator\"),\n    ISleepEventPayloadBuilder: Symbol(\"ISleepEventPayloadBuilder\"),\n    ISleepService: Symbol(\"ISleepService\"),\n    INarrativeService: Symbol(\"INarrativeService\"),\n};\n\n},{}],352:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AttackType = void 0;\n/** @public */\nvar AttackType;\n(function (AttackType) {\n    AttackType[\"physicDamage\"] = \"physicDamage\";\n    AttackType[\"magicDamage\"] = \"magicDamage\";\n    AttackType[\"heal\"] = \"heal\";\n    AttackType[\"buff\"] = \"buff\";\n    AttackType[\"debuff\"] = \"debuff\";\n})(AttackType || (exports.AttackType = AttackType = {}));\n\n},{}],353:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EquipmentTypeToHeroClassMap = exports.HeroClassToEquipmentTypeMap = exports.EquipmentType = void 0;\nconst hero_types_1 = require(\"./hero.types\");\n/** @public */\nvar EquipmentType;\n(function (EquipmentType) {\n    EquipmentType[\"axe\"] = \"axe\";\n    EquipmentType[\"heavyArmor\"] = \"heavyArmor\";\n    EquipmentType[\"shield\"] = \"shield\";\n    EquipmentType[\"ring\"] = \"ring\";\n    EquipmentType[\"gauntlets\"] = \"gauntlets\";\n    EquipmentType[\"sword\"] = \"sword\";\n    EquipmentType[\"armor\"] = \"armor\";\n    EquipmentType[\"helm\"] = \"helm\";\n    EquipmentType[\"belt\"] = \"belt\";\n    EquipmentType[\"gloves\"] = \"gloves\";\n    EquipmentType[\"stuff\"] = \"stuff\";\n    EquipmentType[\"lightArmor\"] = \"lightArmor\";\n    EquipmentType[\"cloak\"] = \"cloak\";\n    EquipmentType[\"earring\"] = \"earring\";\n    EquipmentType[\"bracers\"] = \"bracers\";\n    EquipmentType[\"shortStuff\"] = \"shortStuff\";\n    EquipmentType[\"mantle\"] = \"mantle\";\n    EquipmentType[\"cap\"] = \"cap\";\n    EquipmentType[\"pendant\"] = \"pendant\";\n    EquipmentType[\"book\"] = \"book\";\n    EquipmentType[\"orb\"] = \"orb\";\n    EquipmentType[\"robe\"] = \"robe\";\n    EquipmentType[\"mask\"] = \"mask\";\n    EquipmentType[\"lantern\"] = \"lantern\";\n    EquipmentType[\"amulet\"] = \"amulet\";\n})(EquipmentType || (exports.EquipmentType = EquipmentType = {}));\nexports.HeroClassToEquipmentTypeMap = {\n    [hero_types_1.HeroClass.defender]: [\n        EquipmentType.axe,\n        EquipmentType.heavyArmor,\n        EquipmentType.shield,\n        EquipmentType.ring,\n        EquipmentType.gauntlets,\n    ],\n    [hero_types_1.HeroClass.ranger]: [\n        EquipmentType.sword,\n        EquipmentType.armor,\n        EquipmentType.helm,\n        EquipmentType.belt,\n        EquipmentType.gloves,\n    ],\n    [hero_types_1.HeroClass.mage]: [\n        EquipmentType.stuff,\n        EquipmentType.lightArmor,\n        EquipmentType.cloak,\n        EquipmentType.earring,\n        EquipmentType.bracers,\n    ],\n    [hero_types_1.HeroClass.support]: [\n        EquipmentType.shortStuff,\n        EquipmentType.mantle,\n        EquipmentType.cap,\n        EquipmentType.pendant,\n        EquipmentType.book,\n    ],\n    [hero_types_1.HeroClass.warlock]: [\n        EquipmentType.orb,\n        EquipmentType.robe,\n        EquipmentType.mask,\n        EquipmentType.lantern,\n        EquipmentType.amulet,\n    ],\n};\nexports.EquipmentTypeToHeroClassMap = Object.entries(exports.HeroClassToEquipmentTypeMap).reduce((acc, [heroClass, equipmentTypes]) => {\n    for (const equipmentType of equipmentTypes) {\n        acc.set(equipmentType, heroClass);\n    }\n    return acc;\n}, new Map());\n\n},{\"./hero.types\":355}],354:[function(require,module,exports){\n\"use strict\";\n/** @module definitions */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BundleValidationError = exports.ConfigNeededError = exports.ErrorKey = void 0;\n/** @public */\nvar ErrorKey;\n(function (ErrorKey) {\n    ErrorKey[\"ValidationError\"] = \"ValidationError\";\n    ErrorKey[\"BrokenState\"] = \"BrokenState\";\n    ErrorKey[\"InnerError\"] = \"InnerError\";\n    ErrorKey[\"NotFoundError\"] = \"NotFoundError\";\n    ErrorKey[\"ConfigNeeded\"] = \"ConfigNeeded\";\n})(ErrorKey || (exports.ErrorKey = ErrorKey = {}));\nclass ConfigNeededError extends Error {\n    constructor(message) {\n        super(message);\n        this.key = ErrorKey.ConfigNeeded;\n        this.name = \"ConfigNeededError\";\n    }\n}\nexports.ConfigNeededError = ConfigNeededError;\nclass BundleValidationError extends Error {\n    constructor(message) {\n        super(message);\n        this.key = ErrorKey.ValidationError;\n        this.name = \"ValidationError\";\n    }\n}\nexports.BundleValidationError = BundleValidationError;\n\n},{}],355:[function(require,module,exports){\n\"use strict\";\n/** @module definitions */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HeroRarityStringMap = exports.HeroRarityStrings = exports.HeroRarityArray = exports.HeroRarity = exports.HeroClass = exports.HeroType = void 0;\n/** @public */\nvar HeroType;\n(function (HeroType) {\n    HeroType[\"dino\"] = \"dino\";\n    HeroType[\"alya\"] = \"alya\";\n    HeroType[\"koalin\"] = \"koalin\";\n    HeroType[\"koalor\"] = \"koalor\";\n    HeroType[\"zilla\"] = \"zilla\";\n    HeroType[\"keith\"] = \"keith\";\n    HeroType[\"wontus\"] = \"wontus\";\n    HeroType[\"pago\"] = \"pago\";\n    HeroType[\"kuskus\"] = \"kuskus\";\n    HeroType[\"eukalyptus\"] = \"eukalyptus\";\n    HeroType[\"melona\"] = \"melona\";\n    HeroType[\"mrblaze\"] = \"mrblaze\";\n    HeroType[\"mazhik\"] = \"mazhik\";\n    HeroType[\"reina\"] = \"reina\";\n    HeroType[\"margaery\"] = \"margaery\";\n    HeroType[\"habbard\"] = \"habbard\";\n    HeroType[\"toki\"] = \"toki\";\n    HeroType[\"darkling\"] = \"darkling\";\n    HeroType[\"darkling1\"] = \"darkling1\";\n    HeroType[\"darkling2\"] = \"darkling2\";\n    HeroType[\"darkling3\"] = \"darkling3\";\n    HeroType[\"dinoDarkling\"] = \"dinoDarkling\";\n    HeroType[\"waterElemental\"] = \"waterElemental\";\n    HeroType[\"fireElemental\"] = \"fireElemental\";\n    HeroType[\"fireElemental3\"] = \"fireElemental3\";\n    HeroType[\"fireElement1\"] = \"fireElement1\";\n    HeroType[\"fireElement2\"] = \"fireElement2\";\n    HeroType[\"fireElement3\"] = \"fireElement3\";\n    HeroType[\"waterElement1\"] = \"waterElement1\";\n    HeroType[\"waterElement2\"] = \"waterElement2\";\n    HeroType[\"waterElement3\"] = \"waterElement3\";\n    HeroType[\"earthElement1\"] = \"earthElement1\";\n    HeroType[\"earthElement2\"] = \"earthElement2\";\n    HeroType[\"earthElement3\"] = \"earthElement3\";\n    HeroType[\"airElement1\"] = \"airElement1\";\n    HeroType[\"airElement2\"] = \"airElement2\";\n    HeroType[\"airElement3\"] = \"airElement3\";\n    HeroType[\"gotchi1\"] = \"gotchi1\";\n    HeroType[\"gotchi2\"] = \"gotchi2\";\n    HeroType[\"gotchi3\"] = \"gotchi3\";\n    HeroType[\"gotchiDarkling1\"] = \"gotchiDarkling1\";\n    HeroType[\"gotchiDarkling2\"] = \"gotchiDarkling2\";\n    HeroType[\"gotchiDarkling3\"] = \"gotchiDarkling3\";\n    HeroType[\"tutorialWontus\"] = \"tutorialWontus\";\n    HeroType[\"tutorialMazhik\"] = \"tutorialMazhik\";\n    HeroType[\"margaeryStory\"] = \"margaeryStory\";\n})(HeroType || (exports.HeroType = HeroType = {}));\n/** @public */\nvar HeroClass;\n(function (HeroClass) {\n    HeroClass[\"defender\"] = \"defender\";\n    HeroClass[\"ranger\"] = \"ranger\";\n    HeroClass[\"mage\"] = \"mage\";\n    HeroClass[\"support\"] = \"support\";\n    HeroClass[\"warlock\"] = \"warlock\";\n})(HeroClass || (exports.HeroClass = HeroClass = {}));\n/** @public */\n// always small first\nvar HeroRarity;\n(function (HeroRarity) {\n    HeroRarity[HeroRarity[\"rare\"] = 0] = \"rare\";\n    HeroRarity[HeroRarity[\"epic\"] = 1] = \"epic\";\n    HeroRarity[HeroRarity[\"legendary\"] = 2] = \"legendary\";\n})(HeroRarity || (exports.HeroRarity = HeroRarity = {}));\nexports.HeroRarityArray = Object.values(HeroRarity)\n    .map((i) => Number(i))\n    .filter((i) => !isNaN(i));\nvar HeroRarityStrings;\n(function (HeroRarityStrings) {\n    HeroRarityStrings[\"rare\"] = \"rare\";\n    HeroRarityStrings[\"epic\"] = \"epic\";\n    HeroRarityStrings[\"legendary\"] = \"legendary\";\n})(HeroRarityStrings || (exports.HeroRarityStrings = HeroRarityStrings = {}));\nexports.HeroRarityStringMap = {\n    [HeroRarityStrings.epic]: HeroRarity.epic,\n    [HeroRarityStrings.rare]: HeroRarity.rare,\n    [HeroRarityStrings.legendary]: HeroRarity.legendary,\n};\n\n},{}],356:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./error.types\"), exports);\ntslib_1.__exportStar(require(\"./equipment.types\"), exports);\ntslib_1.__exportStar(require(\"./hero.types\"), exports);\ntslib_1.__exportStar(require(\"./battle.types\"), exports);\ntslib_1.__exportStar(require(\"./sleep.types\"), exports);\n\n},{\"./battle.types\":352,\"./equipment.types\":353,\"./error.types\":354,\"./hero.types\":355,\"./sleep.types\":357,\"tslib\":315}],357:[function(require,module,exports){\n\"use strict\";\n/** @module definitions */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Weekday = exports.SleepPayAttentionTo = exports.SleepClaimType = exports.PerceivedSleepQuality = exports.SleepQuality = void 0;\n/** @public */\nvar SleepQuality;\n(function (SleepQuality) {\n    SleepQuality[\"perfect\"] = \"perfect\";\n    SleepQuality[\"good\"] = \"good\";\n    SleepQuality[\"fair\"] = \"fair\";\n    SleepQuality[\"payAttention\"] = \"payAttention\";\n    SleepQuality[\"noData\"] = \"noData\";\n})(SleepQuality || (exports.SleepQuality = SleepQuality = {}));\n/** @public */\nvar PerceivedSleepQuality;\n(function (PerceivedSleepQuality) {\n    PerceivedSleepQuality[\"great\"] = \"great\";\n    PerceivedSleepQuality[\"good\"] = \"good\";\n    PerceivedSleepQuality[\"unwell\"] = \"unwell\";\n})(PerceivedSleepQuality || (exports.PerceivedSleepQuality = PerceivedSleepQuality = {}));\n/** @public */\nvar SleepClaimType;\n(function (SleepClaimType) {\n    SleepClaimType[\"regular\"] = \"regular\";\n    SleepClaimType[\"claimOnly\"] = \"claimOnly\";\n    SleepClaimType[\"manual\"] = \"manual\";\n})(SleepClaimType || (exports.SleepClaimType = SleepClaimType = {}));\n/** @public */\nvar SleepPayAttentionTo;\n(function (SleepPayAttentionTo) {\n    SleepPayAttentionTo[\"earlyGoToBed\"] = \"earlyGoToBed\";\n    SleepPayAttentionTo[\"lateGoToBed\"] = \"lateGoToBed\";\n    SleepPayAttentionTo[\"lessSleep\"] = \"lessSleep\";\n    SleepPayAttentionTo[\"moreSleep\"] = \"moreSleep\";\n    SleepPayAttentionTo[\"tooLittleSleep\"] = \"tooLittleSleep\";\n    SleepPayAttentionTo[\"tooMuchSleep\"] = \"tooMuchSleep\";\n})(SleepPayAttentionTo || (exports.SleepPayAttentionTo = SleepPayAttentionTo = {}));\n/** @public */\nvar Weekday;\n(function (Weekday) {\n    Weekday[\"monday\"] = \"mon\";\n    Weekday[\"tuesday\"] = \"tue\";\n    Weekday[\"wednesday\"] = \"wed\";\n    Weekday[\"thursday\"] = \"thu\";\n    Weekday[\"friday\"] = \"fri\";\n    Weekday[\"saturdays\"] = \"sat\";\n    Weekday[\"sunday\"] = \"sun\";\n})(Weekday || (exports.Weekday = Weekday = {}));\n\n},{}],358:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toBigVal = void 0;\nfunction toBigVal(n) {\n    let value = n;\n    let multiplier = 0;\n    while (value >= 1000) {\n        value = value / 1000;\n        multiplier = multiplier + 1;\n    }\n    return {\n        value,\n        multiplier,\n    };\n}\nexports.toBigVal = toBigVal;\n\n},{}],359:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FeatureToggleService = exports.FeatureFlags = void 0;\nconst tslib_1 = require(\"tslib\");\n/** @module definitions */\nconst inversify_1 = require(\"inversify\");\n/** @public */\nvar FeatureFlags;\n(function (FeatureFlags) {\n    FeatureFlags[\"allowMultipleClaims\"] = \"allowmultipleclaims\";\n})(FeatureFlags || (exports.FeatureFlags = FeatureFlags = {}));\nlet FeatureToggleService = class FeatureToggleService {\n    constructor() {\n        this.values = {\n            [FeatureFlags.allowMultipleClaims]: false,\n        };\n    }\n    getFeatureValue(featureName, defaultValue) {\n        var _a, _b;\n        return (_b = (_a = this.values[featureName]) !== null && _a !== void 0 ? _a : defaultValue) !== null && _b !== void 0 ? _b : false;\n    }\n    setFeatureValue(featureName, value) {\n        this.values[featureName] = value;\n    }\n};\nexports.FeatureToggleService = FeatureToggleService;\nexports.FeatureToggleService = FeatureToggleService = tslib_1.__decorate([\n    (0, inversify_1.injectable)()\n], FeatureToggleService);\n\n},{\"inversify\":278,\"tslib\":315}],360:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NarrativeService = void 0;\nconst tslib_1 = require(\"tslib\");\nconst inversify_1 = require(\"inversify\");\nconst types_1 = require(\"../types\");\nconst symbols_1 = require(\"../symbols\");\nconst ALL_NARRATIVE_KEYS = [\n    // PERFECT\n    \"sleep.narrative.perfect.variant_1.body\",\n    \"sleep.narrative.perfect.variant_1.title\",\n    \"sleep.narrative.perfect.variant_2.body\",\n    \"sleep.narrative.perfect.variant_2.title\",\n    \"sleep.narrative.perfect.variant_3.body\",\n    \"sleep.narrative.perfect.variant_3.title\",\n    \"sleep.narrative.perfect.variant_4.body\",\n    \"sleep.narrative.perfect.variant_4.title\",\n    \"sleep.narrative.perfect.variant_5.body\",\n    \"sleep.narrative.perfect.variant_5.title\",\n    // GOOD\n    \"sleep.narrative.good.pay_attention_to_early_go_to_bed.variant_1.body\",\n    \"sleep.narrative.good.pay_attention_to_early_go_to_bed.variant_1.title\",\n    \"sleep.narrative.good.pay_attention_to_early_go_to_bed.variant_2.body\",\n    \"sleep.narrative.good.pay_attention_to_early_go_to_bed.variant_2.title\",\n    \"sleep.narrative.good.pay_attention_to_late_go_to_bed.variant_1.body\",\n    \"sleep.narrative.good.pay_attention_to_late_go_to_bed.variant_1.title\",\n    \"sleep.narrative.good.pay_attention_to_late_go_to_bed.variant_2.body\",\n    \"sleep.narrative.good.pay_attention_to_late_go_to_bed.variant_2.title\",\n    \"sleep.narrative.good.pay_attention_to_less_sleep.variant_1.body\",\n    \"sleep.narrative.good.pay_attention_to_less_sleep.variant_1.title\",\n    \"sleep.narrative.good.pay_attention_to_less_sleep.variant_2.body\",\n    \"sleep.narrative.good.pay_attention_to_less_sleep.variant_2.title\",\n    \"sleep.narrative.good.pay_attention_to_more_sleep.variant_1.body\",\n    \"sleep.narrative.good.pay_attention_to_more_sleep.variant_1.title\",\n    \"sleep.narrative.good.pay_attention_to_more_sleep.variant_2.body\",\n    \"sleep.narrative.good.pay_attention_to_more_sleep.variant_2.title\",\n    \"sleep.narrative.good.pay_attention_to_too_little_sleep.variant_1.body\",\n    \"sleep.narrative.good.pay_attention_to_too_little_sleep.variant_1.title\",\n    \"sleep.narrative.good.pay_attention_to_too_much_sleep.variant_1.body\",\n    \"sleep.narrative.good.pay_attention_to_too_much_sleep.variant_1.title\",\n    // FAIR\n    \"sleep.narrative.fair.pay_attention_to_early_go_to_bed.variant_1.body\",\n    \"sleep.narrative.fair.pay_attention_to_early_go_to_bed.variant_1.title\",\n    \"sleep.narrative.fair.pay_attention_to_early_go_to_bed.variant_2.body\",\n    \"sleep.narrative.fair.pay_attention_to_early_go_to_bed.variant_2.title\",\n    \"sleep.narrative.fair.pay_attention_to_late_go_to_bed.variant_1.body\",\n    \"sleep.narrative.fair.pay_attention_to_late_go_to_bed.variant_1.title\",\n    \"sleep.narrative.fair.pay_attention_to_late_go_to_bed.variant_2.body\",\n    \"sleep.narrative.fair.pay_attention_to_late_go_to_bed.variant_2.title\",\n    \"sleep.narrative.fair.pay_attention_to_less_sleep.variant_1.body\",\n    \"sleep.narrative.fair.pay_attention_to_less_sleep.variant_1.title\",\n    \"sleep.narrative.fair.pay_attention_to_less_sleep.variant_2.body\",\n    \"sleep.narrative.fair.pay_attention_to_less_sleep.variant_2.title\",\n    \"sleep.narrative.fair.pay_attention_to_more_sleep.variant_1.body\",\n    \"sleep.narrative.fair.pay_attention_to_more_sleep.variant_1.title\",\n    \"sleep.narrative.fair.pay_attention_to_more_sleep.variant_2.body\",\n    \"sleep.narrative.fair.pay_attention_to_more_sleep.variant_2.title\",\n    \"sleep.narrative.fair.pay_attention_to_too_little_sleep.variant_1.body\",\n    \"sleep.narrative.fair.pay_attention_to_too_little_sleep.variant_1.title\",\n    \"sleep.narrative.fair.pay_attention_to_too_much_sleep.variant_1.body\",\n    \"sleep.narrative.fair.pay_attention_to_too_much_sleep.variant_1.title\",\n    // PAY ATTENTION\n    \"sleep.narrative.pay_attention.pay_attention_to_early_go_to_bed.variant_1.body\",\n    \"sleep.narrative.pay_attention.pay_attention_to_early_go_to_bed.variant_1.title\",\n    \"sleep.narrative.pay_attention.pay_attention_to_early_go_to_bed.variant_2.body\",\n    \"sleep.narrative.pay_attention.pay_attention_to_early_go_to_bed.variant_2.title\",\n    \"sleep.narrative.pay_attention.pay_attention_to_late_go_to_bed.variant_1.body\",\n    \"sleep.narrative.pay_attention.pay_attention_to_late_go_to_bed.variant_1.title\",\n    \"sleep.narrative.pay_attention.pay_attention_to_late_go_to_bed.variant_2.body\",\n    \"sleep.narrative.pay_attention.pay_attention_to_late_go_to_bed.variant_2.title\",\n    \"sleep.narrative.pay_attention.pay_attention_to_less_sleep.variant_1.body\",\n    \"sleep.narrative.pay_attention.pay_attention_to_less_sleep.variant_1.title\",\n    \"sleep.narrative.pay_attention.pay_attention_to_less_sleep.variant_2.body\",\n    \"sleep.narrative.pay_attention.pay_attention_to_less_sleep.variant_2.title\",\n    \"sleep.narrative.pay_attention.pay_attention_to_more_sleep.variant_1.body\",\n    \"sleep.narrative.pay_attention.pay_attention_to_more_sleep.variant_1.title\",\n    \"sleep.narrative.pay_attention.pay_attention_to_more_sleep.variant_2.body\",\n    \"sleep.narrative.pay_attention.pay_attention_to_more_sleep.variant_2.title\",\n    \"sleep.narrative.pay_attention.pay_attention_to_too_little_sleep.variant_1.body\",\n    \"sleep.narrative.pay_attention.pay_attention_to_too_little_sleep.variant_1.title\",\n    \"sleep.narrative.pay_attention.pay_attention_to_too_much_sleep.variant_1.body\",\n    \"sleep.narrative.pay_attention.pay_attention_to_too_much_sleep.variant_1.title\",\n    // NO DATA\n    \"sleep.narrative.no_data.variant_1.body\",\n    \"sleep.narrative.no_data.variant_1.title\",\n];\nconst SLEEP_NARRATIVE_NO_DATA_FALLBACK_TITLE_KEY = \"sleep.narrative.no_data.variant_1.title\";\nconst SLEEP_NARRATIVE_NO_DATA_FALLBACK_BODY_KEY = \"sleep.narrative.no_data.variant_1.body\";\nconst SLEEP_NARRATIVE_PERFECT_FALLBACK_TITLE_KEY = \"sleep.narrative.perfect.variant_1.title\";\nconst SLEEP_NARRATIVE_PERFECT_FALLBACK_BODY_KEY = \"sleep.narrative.perfect.variant_1.body\";\nconst SLEEP_QUALITY_TO_PREFIX = {\n    [types_1.SleepQuality.perfect]: \"sleep.narrative.perfect\",\n    [types_1.SleepQuality.good]: \"sleep.narrative.good\",\n    [types_1.SleepQuality.fair]: \"sleep.narrative.fair\",\n    [types_1.SleepQuality.payAttention]: \"sleep.narrative.pay_attention\",\n    [types_1.SleepQuality.noData]: \"sleep.narrative.no_data\",\n};\nconst SLEEP_IMPROVEMENT_TO_KEY_PART_MAP = {\n    [types_1.SleepPayAttentionTo.earlyGoToBed]: \"pay_attention_to_early_go_to_bed\",\n    [types_1.SleepPayAttentionTo.lateGoToBed]: \"pay_attention_to_late_go_to_bed\",\n    [types_1.SleepPayAttentionTo.lessSleep]: \"pay_attention_to_less_sleep\",\n    [types_1.SleepPayAttentionTo.moreSleep]: \"pay_attention_to_more_sleep\",\n    [types_1.SleepPayAttentionTo.tooLittleSleep]: \"pay_attention_to_too_little_sleep\",\n    [types_1.SleepPayAttentionTo.tooMuchSleep]: \"pay_attention_to_too_much_sleep\",\n};\nlet NarrativeService = class NarrativeService {\n    constructor(randomService) {\n        this.randomService = randomService;\n    }\n    getNarrativeForSleep(sleepQuality, sleepImprovements) {\n        switch (sleepQuality) {\n            case types_1.SleepQuality.good:\n            case types_1.SleepQuality.payAttention:\n            case types_1.SleepQuality.fair:\n                return this.getImprovementNarrative(sleepQuality, sleepImprovements);\n            case types_1.SleepQuality.perfect:\n                return this.getSimpleNarrative(SLEEP_QUALITY_TO_PREFIX[sleepQuality], SLEEP_NARRATIVE_PERFECT_FALLBACK_TITLE_KEY, SLEEP_NARRATIVE_PERFECT_FALLBACK_BODY_KEY);\n            case types_1.SleepQuality.noData:\n                return this.getSimpleNarrative(SLEEP_QUALITY_TO_PREFIX[sleepQuality], SLEEP_NARRATIVE_NO_DATA_FALLBACK_TITLE_KEY, SLEEP_NARRATIVE_NO_DATA_FALLBACK_BODY_KEY);\n            default:\n                throw new Error(`Unsupported sleep quality: ${sleepQuality}`);\n        }\n    }\n    getSimpleNarrative(keyPrefix, fallbackTitleKey, fallbackBodyKey) {\n        const variants = this.getVariants(keyPrefix);\n        const variant = this.randomService.getRandomElement(variants);\n        if ((variant === null || variant === void 0 ? void 0 : variant.title) == null || variant.body == null) {\n            return {\n                title: fallbackTitleKey,\n                body: fallbackBodyKey,\n            };\n        }\n        return {\n            title: variant.title,\n            body: variant.body,\n        };\n    }\n    getImprovementNarrative(sleepQuality, sleepImprovements) {\n        const keyPrefix = SLEEP_QUALITY_TO_PREFIX[sleepQuality];\n        const improvement = this.randomService.getRandomElement(sleepImprovements);\n        const keyPart = SLEEP_IMPROVEMENT_TO_KEY_PART_MAP[improvement];\n        const variants = this.getVariants(`${keyPrefix}.${keyPart}`);\n        const variant = this.randomService.getRandomElement(variants);\n        if ((variant === null || variant === void 0 ? void 0 : variant.title) == null || variant.body == null) {\n            throw new Error(`No narrative variant found for key: ${keyPrefix}.${keyPart}`);\n        }\n        return {\n            title: variant.title,\n            body: variant.body,\n        };\n    }\n    getVariants(keyPrefix) {\n        var _a;\n        const variants = {};\n        const keys = ALL_NARRATIVE_KEYS.filter((key) => key.startsWith(keyPrefix));\n        for (const key of keys) {\n            const [, keyRest] = key.split(keyPrefix);\n            const match = /\\.(variant_\\d+)(?:\\.(\\w+)$|$)/.exec(keyRest);\n            if (match == null) {\n                continue;\n            }\n            const [, variant, subKey] = match;\n            const obj = ((_a = variants[variant]) !== null && _a !== void 0 ? _a : (variants[variant] = {}));\n            obj[subKey !== null && subKey !== void 0 ? subKey : \"_message_\"] = key;\n        }\n        return Object.values(variants);\n    }\n};\nexports.NarrativeService = NarrativeService;\nexports.NarrativeService = NarrativeService = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.IRandomService))\n], NarrativeService);\n\n},{\"../symbols\":351,\"../types\":356,\"inversify\":278,\"tslib\":315}],361:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SleepBonusCalculator = void 0;\nconst tslib_1 = require(\"tslib\");\nconst inversify_1 = require(\"inversify\");\nconst types_1 = require(\"../types\");\n// Fast erf approximation (Abramowitz & Stegun 7.1.26)\nfunction erf(x) {\n    const a1 = 0.254829592;\n    const a2 = -0.284496736;\n    const a3 = 1.421413741;\n    const a4 = -1.453152027;\n    const a5 = 1.061405429;\n    const p = 0.3275911;\n    const sign = x < 0 ? -1 : 1;\n    const ax = Math.abs(x);\n    const t = 1 / (1 + p * ax);\n    const y = 1 - ((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t * Math.exp(-ax * ax);\n    return sign * y;\n}\n/**\n * Bands mirror the second service:\n * - Points bands with min/max (85..100, 75..84, 60..74, 40..59)\n * - Band-local deltas with pivots for erf scaling\n * - Absolute duration required for perfect/good/fair (not for payAttention)\n */\nconst sleepConfigDefault = {\n    quality: {\n        // kept for compatibility (not used by the formula below)\n        goToBedParts: 3,\n        durationParts: 2,\n        entries: [\n            {\n                sleepQuality: types_1.SleepQuality.perfect,\n                goToBedDelta: {\n                    minNegative: -30,\n                    maxPositive: 15,\n                    pivotNeg: 0,\n                    pivotPos: 0,\n                },\n                durationDelta: {\n                    minNegative: -30,\n                    maxPositive: 60,\n                    pivotNeg: 0,\n                    pivotPos: 0,\n                },\n                duration: {\n                    min: 6.5 * 60,\n                    max: 12 * 60,\n                },\n                needsDurationAbs: true,\n                minSleepPoints: 85,\n                maxSleepPoints: 100,\n            },\n            {\n                sleepQuality: types_1.SleepQuality.good,\n                goToBedDelta: {\n                    minNegative: -60,\n                    maxPositive: 60,\n                    pivotNeg: -30,\n                    pivotPos: 15,\n                },\n                durationDelta: {\n                    minNegative: -60,\n                    maxPositive: 120,\n                    pivotNeg: -30,\n                    pivotPos: 60,\n                },\n                duration: {\n                    min: 6 * 60,\n                    max: 12 * 60,\n                },\n                needsDurationAbs: true,\n                minSleepPoints: 75,\n                maxSleepPoints: 84,\n            },\n            {\n                sleepQuality: types_1.SleepQuality.fair,\n                goToBedDelta: {\n                    minNegative: -90,\n                    maxPositive: 90,\n                    pivotNeg: -60,\n                    pivotPos: 60,\n                },\n                durationDelta: {\n                    minNegative: -90,\n                    maxPositive: 150,\n                    pivotNeg: -60,\n                    pivotPos: 120,\n                },\n                duration: {\n                    min: 5.5 * 60,\n                    max: 12 * 60,\n                },\n                needsDurationAbs: true,\n                minSleepPoints: 60,\n                maxSleepPoints: 74,\n            },\n            {\n                sleepQuality: types_1.SleepQuality.payAttention,\n                goToBedDelta: {\n                    minNegative: -120,\n                    maxPositive: 120,\n                    pivotNeg: -90,\n                    pivotPos: 90,\n                },\n                durationDelta: {\n                    minNegative: -120,\n                    maxPositive: 180,\n                    pivotNeg: -90,\n                    pivotPos: 150,\n                },\n                // no absolute duration requirement for this band\n                needsDurationAbs: false,\n                // kept only for improvement hints\n                duration: { min: 1, max: 15 * 60 },\n                minSleepPoints: 40,\n                maxSleepPoints: 59,\n            },\n        ],\n    },\n};\nlet SleepBonusCalculator = class SleepBonusCalculator {\n    constructor(sleepConfig = sleepConfigDefault) {\n        this.sleepConfig = sleepConfig;\n    }\n    /**\n     * Band selection that matches SleepPointsCalculator:\n     * - bed & duration deltas must be in-band\n     * - for perfect/good/fair: actual duration must be within absolute window\n     * - fallback to payAttention\n     */\n    getSleepQuality(goToBedDelta, durationDelta, duration) {\n        var _a;\n        const { entries } = this.sleepConfig.quality;\n        const found = entries.find((e) => {\n            const bedOK = goToBedDelta >= e.goToBedDelta.minNegative && goToBedDelta <= e.goToBedDelta.maxPositive;\n            const durOK = durationDelta >= e.durationDelta.minNegative && durationDelta <= e.durationDelta.maxPositive;\n            const absOK = e.needsDurationAbs ? duration >= e.duration.min && duration <= e.duration.max : true;\n            return bedOK && durOK && absOK;\n        });\n        return (_a = found === null || found === void 0 ? void 0 : found.sleepQuality) !== null && _a !== void 0 ? _a : types_1.SleepQuality.payAttention;\n    }\n    /**\n     * Points with erf smoothing using band-local pivots (3/5 bedtime + 2/5 duration),\n     * clamped to the band's [min,max].\n     */\n    getSleepPoints(goToBedDelta, durationDelta, duration, quality) {\n        const { entries } = this.sleepConfig.quality;\n        const sleepQuality = quality !== null && quality !== void 0 ? quality : this.getSleepQuality(goToBedDelta, durationDelta, duration);\n        const entryIndex = entries.findIndex((e) => e.sleepQuality === sleepQuality);\n        if (entryIndex === -1) {\n            throw new Error(`Sleep quality ${sleepQuality} not found in sleep config`);\n        }\n        const e = entries[entryIndex];\n        const span = e.maxSleepPoints - e.minSleepPoints;\n        // weights 3/5 and 2/5, halved inside erf form: A*(1 - erf(...))\n        const aBed = (span * 3) / 5 / 2;\n        const aDur = (span * 2) / 5 / 2;\n        // scale x from [pivot..bound] to [-2..+2] with zero-denominator guard\n        const scale = (x, pivot, bound) => {\n            const denomRaw = bound - pivot;\n            const denom = denomRaw === 0 ? 1 : denomRaw;\n            return (4 * (x - pivot)) / denom - 2;\n        };\n        const bedPivot = goToBedDelta < 0 ? e.goToBedDelta.pivotNeg : e.goToBedDelta.pivotPos;\n        const bedBound = goToBedDelta < 0 ? e.goToBedDelta.minNegative : e.goToBedDelta.maxPositive;\n        const durPivot = durationDelta < 0 ? e.durationDelta.pivotNeg : e.durationDelta.pivotPos;\n        const durBound = durationDelta < 0 ? e.durationDelta.minNegative : e.durationDelta.maxPositive;\n        const termBed = aBed * (1 - erf(scale(goToBedDelta, bedPivot, bedBound)));\n        const termDur = aDur * (1 - erf(scale(durationDelta, durPivot, durBound)));\n        const raw = Math.round(e.minSleepPoints + termBed + termDur);\n        if (raw < e.minSleepPoints)\n            return e.minSleepPoints;\n        if (raw > e.maxSleepPoints)\n            return e.maxSleepPoints;\n        return raw;\n    }\n    /**\n     * Produces improvement hints relative to the next-better band.\n     * Slightly flattened to reduce cognitive complexity.\n     */\n    getSleepImprovements(goToBedDelta, durationDelta, duration) {\n        const improvements = [];\n        const { entries } = this.sleepConfig.quality;\n        const sleepQuality = this.getSleepQuality(goToBedDelta, durationDelta, duration);\n        const idx = entries.findIndex((e) => e.sleepQuality === sleepQuality);\n        if (idx === -1) {\n            throw new Error(`Sleep quality ${sleepQuality} not found in sleep config`);\n        }\n        const prev = entries[idx - 1];\n        if (prev == null)\n            return improvements; // already at top band\n        // Duration absolute window (only if prev requires it)\n        if (prev.needsDurationAbs) {\n            if (duration < prev.duration.min) {\n                improvements.push(types_1.SleepPayAttentionTo.tooLittleSleep);\n            }\n            else if (duration > prev.duration.max) {\n                improvements.push(types_1.SleepPayAttentionTo.tooMuchSleep);\n            }\n        }\n        // Bedtime delta vs previous band's acceptable range\n        if (goToBedDelta < prev.goToBedDelta.minNegative) {\n            improvements.push(types_1.SleepPayAttentionTo.earlyGoToBed);\n        }\n        else if (goToBedDelta > prev.goToBedDelta.maxPositive) {\n            improvements.push(types_1.SleepPayAttentionTo.lateGoToBed);\n        }\n        // Duration delta vs previous band's acceptable range\n        if (durationDelta < prev.durationDelta.minNegative) {\n            improvements.push(types_1.SleepPayAttentionTo.lessSleep);\n        }\n        else if (durationDelta > prev.durationDelta.maxPositive) {\n            improvements.push(types_1.SleepPayAttentionTo.moreSleep);\n        }\n        return improvements;\n    }\n};\nexports.SleepBonusCalculator = SleepBonusCalculator;\nexports.SleepBonusCalculator = SleepBonusCalculator = tslib_1.__decorate([\n    (0, inversify_1.injectable)()\n], SleepBonusCalculator);\n\n},{\"../types\":356,\"inversify\":278,\"tslib\":315}],362:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TimeService = void 0;\nconst tslib_1 = require(\"tslib\");\nconst inversify_1 = require(\"inversify\");\nlet TimeService = class TimeService {\n    now() {\n        return Date.now();\n    }\n    getDate() {\n        return new Date();\n    }\n};\nexports.TimeService = TimeService;\nexports.TimeService = TimeService = tslib_1.__decorate([\n    (0, inversify_1.injectable)()\n], TimeService);\n\n},{\"inversify\":278,\"tslib\":315}],363:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UuidGenerator = void 0;\nconst tslib_1 = require(\"tslib\");\nconst inversify_1 = require(\"inversify\");\nconst uuid_1 = require(\"@lukeed/uuid\");\nlet UuidGenerator = class UuidGenerator {\n    generateUuid() {\n        return (0, uuid_1.v4)();\n    }\n};\nexports.UuidGenerator = UuidGenerator;\nexports.UuidGenerator = UuidGenerator = tslib_1.__decorate([\n    (0, inversify_1.injectable)()\n], UuidGenerator);\n\n},{\"@lukeed/uuid\":31,\"inversify\":278,\"tslib\":315}],364:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConfigValidator = void 0;\nconst tslib_1 = require(\"tslib\");\nconst inversify_1 = require(\"inversify\");\nconst types_1 = require(\"../../types\");\nconst types_2 = require(\"../../client/types\");\nlet ConfigValidator = class ConfigValidator {\n    checkBattleConfig(rawRecord) {\n        const record = (0, types_1.BattlesConfigValidator)(rawRecord);\n        const battleKeys = new Set();\n        const battles = {};\n        for (const [battleId, enemies] of Object.entries(record)) {\n            if (battleKeys.has(battleId)) {\n                throw new Error(`battleId duplicate in enemies.json config - ${battleId}`);\n            }\n            battleKeys.add(battleId);\n            battles[battleId] = enemies;\n        }\n        return battles;\n    }\n    updateIn(obj, path, updater) {\n        const [head, ...tail] = path.split(\".\");\n        const record = obj !== null && obj !== undefined && typeof obj === \"object\" ? obj : {};\n        if (tail.length === 0) {\n            return Object.assign(Object.assign({}, record), { [head]: updater(record[head]) });\n        }\n        const child = record[head];\n        const updatedChild = this.updateIn(child, tail.join(\".\"), updater);\n        return Object.assign(Object.assign({}, record), { [head]: updatedChild });\n    }\n    checkBaseConfig(rawRecord) {\n        const mapRarity = (item) => {\n            if (item !== null &&\n                item !== undefined &&\n                typeof item === \"object\" &&\n                Object.prototype.hasOwnProperty.call(item, \"heroRarity\") &&\n                typeof item.heroRarity === \"string\") {\n                const rec = item;\n                const key = rec.heroRarity;\n                return Object.assign(Object.assign({}, rec), { heroRarity: types_2.HeroRarityStringMap[key] });\n            }\n            return item;\n        };\n        const paths = [\n            \"heroesConfig.heroes\",\n            \"rewardsConfig.defaultDropRules.heroStarDust.heroRarity\",\n            \"rewardsConfig.defaultDropRules.heroCard.heroRarity\",\n        ];\n        const mapped = paths.reduce((acc, p) => this.updateIn(acc, p, (arr) => (Array.isArray(arr) ? arr.map(mapRarity) : [])), rawRecord);\n        return (0, types_1.BaseConfigValidator)(mapped);\n    }\n    checkDialoguesConfig(rawRecord) {\n        return (0, types_1.DialoguesConfigValidator)(rawRecord);\n    }\n    checkHuntConfig(rawRecord) {\n        return (0, types_1.HuntConfigValidator)(rawRecord);\n    }\n    checkPathConfig(rawConfig) {\n        const rawEvents = Array.isArray(rawConfig) ? rawConfig : [];\n        // get rid of empty strings(\"\") from each path event body\n        const cleanedEvents = rawEvents.map((pathEvent) => {\n            // Only treat actual objects\n            if (pathEvent !== null && typeof pathEvent === \"object\") {\n                const eventObject = pathEvent;\n                const prunedEvent = {};\n                for (const [propertyKey, propertyValue] of Object.entries(eventObject)) {\n                    // keep everything except explicit empty strings\n                    if (!(typeof propertyValue === \"string\" && propertyValue === \"\")) {\n                        prunedEvent[propertyKey] = propertyValue;\n                    }\n                }\n                return prunedEvent;\n            }\n            // Non‐objects are left intact so the runtype can catch the error\n            return pathEvent;\n        });\n        return (0, types_1.PathConfigValidator)(cleanedEvents);\n    }\n    checkRewardsConfig(rawRecord) {\n        const record = (0, types_1.RewardConfigValidator)(rawRecord);\n        const reardsKeys = new Set();\n        const rewardsConfig = {};\n        for (const [rewardId, rewards] of Object.entries(record)) {\n            if (reardsKeys.has(rewardId)) {\n                throw new Error(`rewardId duplicate in rewards.json config - ${rewardId}`);\n            }\n            reardsKeys.add(rewardId);\n            rewardsConfig[rewardId] = rewards;\n        }\n        return rewardsConfig;\n    }\n    // TODO: input: all configs; check if all rewards are present;\n    checkConsistency() { }\n    checkRuntime(configs) {\n        configs.base = this.checkBaseConfig(configs.base);\n        configs.battles = this.checkBattleConfig(configs.battles);\n        configs.currentPath = this.checkPathConfig(configs.currentPath);\n        configs.dialogues = this.checkDialoguesConfig(configs.dialogues);\n        configs.hunt = this.checkHuntConfig(configs.hunt);\n        configs.nextPath = this.checkPathConfig(configs.nextPath);\n        configs.rewards = this.checkRewardsConfig(configs.rewards);\n    }\n    checkPathId(pathId) {\n        return (0, types_1.PathIdValidator)(pathId);\n    }\n    isPathId(pathId) {\n        return types_1.PathIdGuard.guard(pathId);\n    }\n};\nexports.ConfigValidator = ConfigValidator;\nexports.ConfigValidator = ConfigValidator = tslib_1.__decorate([\n    (0, inversify_1.injectable)()\n], ConfigValidator);\n\n},{\"../../client/types\":356,\"../../types\":367,\"inversify\":278,\"tslib\":315}],365:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RandomService = exports.RNGFactory = void 0;\nconst tslib_1 = require(\"tslib\");\nconst inversify_1 = require(\"inversify\");\nconst seedrandom_1 = tslib_1.__importDefault(require(\"seedrandom\"));\nconst symbols_1 = require(\"../client/symbols\");\nlet RNGFactory = class RNGFactory {\n    create(seed) {\n        const rng = (0, seedrandom_1.default)(seed);\n        return new RngProxy(rng);\n    }\n};\nexports.RNGFactory = RNGFactory;\nexports.RNGFactory = RNGFactory = tslib_1.__decorate([\n    (0, inversify_1.injectable)()\n], RNGFactory);\nclass RngProxy {\n    constructor(rng) {\n        this.rng = rng;\n        this.calls = 0;\n    }\n    random() {\n        this.calls++;\n        return this.rng();\n    }\n}\nlet RandomService = class RandomService {\n    constructor(rng, rngFactory) {\n        this.rng = rng;\n        this.rngFactory = rngFactory;\n    }\n    yesNo(yesRate) {\n        return this.rng.random() < yesRate;\n    }\n    randomInt(max, min = 0) {\n        return Math.floor(this.rng.random() * (max - min)) + min;\n    }\n    getRandomElement(array) {\n        return array[this.randomInt(array.length)];\n    }\n    getRandomWeightedElement(array, weights) {\n        const factor = 1000;\n        const totalWeight = weights.reduce((acc, weight) => acc + weight * factor, 0);\n        const random = this.randomInt(totalWeight);\n        let currentWeight = 0;\n        for (let i = 0; i < array.length; i++) {\n            currentWeight += weights[i] * factor;\n            if (random < currentWeight) {\n                return array[i];\n            }\n        }\n        return array[array.length - 1];\n    }\n    randomSort(array) {\n        const arrayCopy = array.slice();\n        for (let i = arrayCopy.length - 1; i > 0; i--) {\n            const j = Math.floor(this.rng.random() * (i + 1));\n            [arrayCopy[i], arrayCopy[j]] = [arrayCopy[j], arrayCopy[i]];\n        }\n        return arrayCopy;\n    }\n    getRandomSeed() {\n        return this.rng.random().toString();\n    }\n};\nexports.RandomService = RandomService;\nexports.RandomService = RandomService = tslib_1.__decorate([\n    (0, inversify_1.injectable)(),\n    tslib_1.__param(0, (0, inversify_1.inject)(symbols_1.Symbols.RootRNG)),\n    tslib_1.__param(1, (0, inversify_1.inject)(symbols_1.Symbols.IRNGFactory))\n], RandomService);\n\n},{\"../client/symbols\":351,\"inversify\":278,\"seedrandom\":306,\"tslib\":315}],366:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateGuard = exports.generateValidator = void 0;\nconst compiler_1 = require(\"@sinclair/typebox/compiler\");\nconst types_1 = require(\"../client/types\");\nfunction generateValidator(schema) {\n    const checkFunction = compiler_1.TypeCompiler.Compile(schema);\n    return (input) => {\n        if (!checkFunction.Check(input)) {\n            throw new types_1.BundleValidationError([...checkFunction.Errors(input)].map((err) => `${err.path} - ${err.message}`).join(\" | \"));\n        }\n        return input;\n    };\n}\nexports.generateValidator = generateValidator;\nfunction generateGuard(schema) {\n    const checkFunction = compiler_1.TypeCompiler.Compile(schema);\n    return {\n        guard: (input) => checkFunction.Check(input),\n        errors: (input) => [...checkFunction.Errors(input)].map((err) => `${err.path} - ${err.message}`).join(\" | \"),\n    };\n}\nexports.generateGuard = generateGuard;\n\n},{\"../client/types\":356,\"@sinclair/typebox/compiler\":33}],367:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./types.enums\"), exports);\ntslib_1.__exportStar(require(\"./types.schemas\"), exports);\ntslib_1.__exportStar(require(\"./types.common\"), exports);\ntslib_1.__exportStar(require(\"./types.configs\"), exports);\ntslib_1.__exportStar(require(\"./types.validators\"), exports);\n\n},{\"./types.common\":368,\"./types.configs\":369,\"./types.enums\":370,\"./types.schemas\":372,\"./types.validators\":373,\"tslib\":315}],368:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SleepQualitySchema = exports.PerceivedSleepQualitySchema = exports.FurnitureIdSchema = exports.RngSeedSchema = exports.WeekdaySchema = exports.BattleAttackTypeSchema = exports.HeroClassSchema = exports.HeroRaritySchema = exports.HeroTypeSchema = exports.NonNegIntPercentSchema = exports.NotEmptyStringSchema = exports.TimestampMsSchema = exports.DateStringSchema = exports.DateTimeStringSchema = exports.NonNegNumberSchema = exports.NonNegIntSchema = exports.PosIntSchema = void 0;\nconst typebox_1 = require(\"@sinclair/typebox\");\nconst types_1 = require(\"../client/types\");\nconst types_formats_1 = require(\"./types.formats\");\ntypebox_1.FormatRegistry.Set(\"date-time\", (value) => (0, types_formats_1.IsDateTime)(value));\ntypebox_1.FormatRegistry.Set(\"date\", (value) => (0, types_formats_1.IsDate)(value));\nconst MIN_DATE = new Date(\"2024-01-01\");\nexports.PosIntSchema = typebox_1.Type.Number({ exclusiveMinimum: 0, multipleOf: 1 });\nexports.NonNegIntSchema = typebox_1.Type.Number({ minimum: 0, multipleOf: 1 });\nexports.NonNegNumberSchema = typebox_1.Type.Number({ minimum: 0 });\nexports.DateTimeStringSchema = typebox_1.Type.String({ format: \"date-time\" });\nexports.DateStringSchema = typebox_1.Type.String({ format: \"date\" });\nexports.TimestampMsSchema = typebox_1.Type.Number({ multipleOf: 1, minimum: MIN_DATE.getTime() });\nexports.NotEmptyStringSchema = typebox_1.Type.String({ minLength: 1 });\nexports.NonNegIntPercentSchema = typebox_1.Type.Number({ multipleOf: 1, minimum: 0, maximum: 100 });\nexports.HeroTypeSchema = typebox_1.Type.Enum(types_1.HeroType);\nexports.HeroRaritySchema = typebox_1.Type.Number({ minimum: types_1.HeroRarity.rare, maximum: types_1.HeroRarity.legendary, multipleOf: 1 });\nexports.HeroClassSchema = typebox_1.Type.Enum(types_1.HeroClass);\nexports.BattleAttackTypeSchema = typebox_1.Type.Enum(types_1.AttackType);\nexports.WeekdaySchema = typebox_1.Type.Enum(types_1.Weekday);\nexports.RngSeedSchema = typebox_1.Type.String({ minLength: 1 });\n// eslint-disable-next-line no-template-curly-in-string\nexports.FurnitureIdSchema = typebox_1.Type.TemplateLiteral(\"${string}_type_${number}_lvl_${number}\");\nexports.PerceivedSleepQualitySchema = typebox_1.Type.Enum(types_1.PerceivedSleepQuality);\nexports.SleepQualitySchema = typebox_1.Type.Enum(types_1.SleepQuality);\n\n},{\"../client/types\":356,\"./types.formats\":371,\"@sinclair/typebox\":37}],369:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConfigsRecordSchema = exports.BaseConfigSchema = exports.HeroesConfigSchema = exports.HeroConfigSchema = exports.ConstantsConfigSchema = exports.ConstantsNumber = exports.ConstantsStrings = exports.ConstantKey = exports.DialoguesConfigSchema = exports.HuntConfigSchema = exports.RewardConfigFileSchema = exports.RewardPackSchema = exports.RewardConfigSchema = exports.RewardRangenVariantSchema = exports.RewardWeightedVariantSchema = exports.ResourceRewardSchema = exports.FurnitureRewardSchema = exports.HeroStarDustRewardSchema = exports.HeroCardRewardSchema = exports.BaseRewardSchema = exports.BattlesConfigSchema = exports.PathConfigSchema = exports.PathIdSchema = void 0;\nconst typebox_1 = require(\"@sinclair/typebox\");\nconst types_common_1 = require(\"./types.common\");\nconst types_enums_1 = require(\"./types.enums\");\n// ------------- Path -------------------- //\n// eslint-disable-next-line no-template-curly-in-string\nexports.PathIdSchema = typebox_1.Type.TemplateLiteral([typebox_1.Type.TemplateLiteral(\"p${number}\"), typebox_1.Type.Enum(types_enums_1.PathType)]);\nconst PathEventDialogueSchema = typebox_1.Type.Object({\n    nodeId: types_common_1.NotEmptyStringSchema,\n    event: typebox_1.Type.Literal(types_enums_1.GoEventType.dialogue),\n    nodePrefab: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n    eventParameter: types_common_1.NotEmptyStringSchema,\n    reward: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n    dialogueAfter: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n    dialogueBefore: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n});\nconst PathEventBattleSchema = typebox_1.Type.Object({\n    nodeId: types_common_1.NotEmptyStringSchema,\n    event: typebox_1.Type.Literal(types_enums_1.GoEventType.battle),\n    nodePrefab: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n    eventParameter: types_common_1.NotEmptyStringSchema,\n    reward: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n    dialogueAfter: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n    dialogueBefore: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n});\nconst PathEventCarouselSchema = typebox_1.Type.Object({\n    nodeId: types_common_1.NotEmptyStringSchema,\n    event: typebox_1.Type.Literal(types_enums_1.GoEventType.carousel),\n    nodePrefab: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n    reward: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n    dialogueAfter: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n    dialogueBefore: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n});\nconst PathEventCutsceneSchema = typebox_1.Type.Object({\n    nodeId: types_common_1.NotEmptyStringSchema,\n    event: typebox_1.Type.Literal(types_enums_1.GoEventType.cutscene),\n    nodePrefab: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n    dialogueBefore: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n    eventParameter: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n    dialogueAfter: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n    reward: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n});\nconst PathEventSchema = typebox_1.Type.Union([\n    PathEventBattleSchema,\n    PathEventCarouselSchema,\n    PathEventDialogueSchema,\n    PathEventCutsceneSchema,\n]);\nexports.PathConfigSchema = typebox_1.Type.Array(PathEventSchema);\n// ------------- Path  END -------------------- //\n// ------------- Battles -------------------- //\nconst EnemySchema = typebox_1.Type.Object({\n    character: types_common_1.HeroTypeSchema,\n    level: types_common_1.PosIntSchema,\n    x: types_common_1.PosIntSchema,\n    y: types_common_1.PosIntSchema,\n});\nconst EnemiesSchema = typebox_1.Type.Array(EnemySchema);\nexports.BattlesConfigSchema = typebox_1.Type.Record(typebox_1.Type.String(), EnemiesSchema);\n// ------------- Battles End -------------------- //\n// --------------- Rewards  -------------------- //\nexports.BaseRewardSchema = typebox_1.Type.Object({\n    type: typebox_1.Type.Union([\n        typebox_1.Type.Literal(types_enums_1.ResourceType.gold),\n        typebox_1.Type.Literal(types_enums_1.ResourceType.gem),\n        typebox_1.Type.Literal(types_enums_1.ResourceType.xp),\n        typebox_1.Type.Literal(types_enums_1.ResourceType.purpleMoonDrop),\n        typebox_1.Type.Literal(types_enums_1.ResourceType.greenMoonDrop),\n        typebox_1.Type.Literal(types_enums_1.ResourceType.gachaToken),\n        typebox_1.Type.Literal(types_enums_1.ResourceType.streakFreeze),\n        typebox_1.Type.Literal(types_enums_1.ResourceType.vSleep),\n    ]),\n    variant: typebox_1.Type.Object({ amount: typebox_1.Type.Number() }),\n});\nexports.HeroCardRewardSchema = typebox_1.Type.Object({\n    type: typebox_1.Type.Literal(types_enums_1.ResourceType.heroCard),\n    payload: typebox_1.Type.Object({ heroType: types_common_1.HeroTypeSchema }),\n});\nexports.HeroStarDustRewardSchema = typebox_1.Type.Object({\n    type: typebox_1.Type.Literal(types_enums_1.ResourceType.heroStarDust),\n    payload: typebox_1.Type.Object({ heroRarity: types_common_1.HeroRaritySchema }),\n    amount: typebox_1.Type.Number(),\n});\nexports.FurnitureRewardSchema = typebox_1.Type.Object({\n    type: typebox_1.Type.Literal(types_enums_1.ResourceType.furniture),\n    payload: typebox_1.Type.Object({\n        furnitureId: types_common_1.FurnitureIdSchema,\n        furnitureName: typebox_1.Type.Optional(typebox_1.Type.String()),\n        furnitureType: typebox_1.Type.Optional(typebox_1.Type.Number()),\n        furnitureLevel: typebox_1.Type.Optional(typebox_1.Type.Number()),\n        isSelectable: typebox_1.Type.Optional(typebox_1.Type.Boolean()),\n        isClaimed: typebox_1.Type.Optional(typebox_1.Type.Boolean()),\n    }),\n});\nexports.ResourceRewardSchema = typebox_1.Type.Union([\n    exports.BaseRewardSchema,\n    exports.HeroCardRewardSchema,\n    exports.HeroStarDustRewardSchema,\n    exports.FurnitureRewardSchema,\n]);\nexports.RewardWeightedVariantSchema = typebox_1.Type.Object({\n    amount: types_common_1.PosIntSchema,\n    weight: types_common_1.NonNegIntPercentSchema,\n});\nexports.RewardRangenVariantSchema = typebox_1.Type.Object({\n    minAmount: types_common_1.PosIntSchema,\n    maxAmount: types_common_1.PosIntSchema,\n});\nconst RewardConfigRangeSchema = {\n    variantType: typebox_1.Type.Literal(\"range\"),\n    variants: exports.RewardRangenVariantSchema,\n};\nconst RewardConfigWeightedSchema = {\n    variantType: typebox_1.Type.Literal(\"weight\"),\n    variants: typebox_1.Type.Array(exports.RewardWeightedVariantSchema),\n};\nconst RewardConfigStaticSchema = {\n    variantType: typebox_1.Type.Literal(\"static\"),\n    amount: types_common_1.PosIntSchema,\n};\nconst RewardConfigContentSimpleSchema = {\n    type: typebox_1.Type.Union([\n        typebox_1.Type.Literal(types_enums_1.ResourceType.gold),\n        typebox_1.Type.Literal(types_enums_1.ResourceType.gem),\n        typebox_1.Type.Literal(types_enums_1.ResourceType.xp),\n        typebox_1.Type.Literal(types_enums_1.ResourceType.purpleMoonDrop),\n        typebox_1.Type.Literal(types_enums_1.ResourceType.greenMoonDrop),\n        typebox_1.Type.Literal(types_enums_1.ResourceType.gachaToken),\n        typebox_1.Type.Literal(types_enums_1.ResourceType.streakFreeze),\n        typebox_1.Type.Literal(types_enums_1.ResourceType.heroCard),\n        typebox_1.Type.Literal(types_enums_1.ResourceType.heroStarDust),\n        typebox_1.Type.Literal(types_enums_1.ResourceType.vSleep),\n    ]),\n};\nconst RewardConfigContentFurnitureSchema = {\n    type: typebox_1.Type.Literal(types_enums_1.ResourceType.furniture),\n    furnitureId: types_common_1.FurnitureIdSchema,\n};\nconst RewardConfigContentSimpleRangeSchema = typebox_1.Type.Object(Object.assign(Object.assign({}, RewardConfigRangeSchema), RewardConfigContentSimpleSchema));\nconst RewardConfigContentSimpleWeightedSchema = typebox_1.Type.Object(Object.assign(Object.assign({}, RewardConfigWeightedSchema), RewardConfigContentSimpleSchema));\nconst RewardConfigContentSimpleStaticSchema = typebox_1.Type.Object(Object.assign(Object.assign({}, RewardConfigStaticSchema), RewardConfigContentSimpleSchema));\nconst RewardConfigContentFurnitureRangeSchema = typebox_1.Type.Object(Object.assign(Object.assign({}, RewardConfigRangeSchema), RewardConfigContentFurnitureSchema));\nconst RewardConfigContentFurnitureWeightedSchema = typebox_1.Type.Object(Object.assign(Object.assign({}, RewardConfigWeightedSchema), RewardConfigContentFurnitureSchema));\nconst RewardConfigContentFurnitureStaticSchema = typebox_1.Type.Object(Object.assign(Object.assign({}, RewardConfigStaticSchema), RewardConfigContentFurnitureSchema));\nexports.RewardConfigSchema = typebox_1.Type.Union([\n    RewardConfigContentSimpleRangeSchema,\n    RewardConfigContentSimpleWeightedSchema,\n    RewardConfigContentSimpleStaticSchema,\n    RewardConfigContentFurnitureRangeSchema,\n    RewardConfigContentFurnitureWeightedSchema,\n    RewardConfigContentFurnitureStaticSchema,\n]);\nexports.RewardPackSchema = typebox_1.Type.Array(exports.RewardConfigSchema);\nexports.RewardConfigFileSchema = typebox_1.Type.Record(typebox_1.Type.String(), exports.RewardPackSchema);\n// --------------------- Rewards End ------------------- //\n// ---------------------- Hunt ------------------------//\nconst HuntStageSchema = typebox_1.Type.Object({\n    battle: types_common_1.NotEmptyStringSchema,\n    reward: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n});\nexports.HuntConfigSchema = typebox_1.Type.Array(HuntStageSchema);\n//----------------------- Hunt End ------------------ //\n// --------------------- Dialogues ------------------ //\nconst DialogueLineSchema = typebox_1.Type.Object({\n    replicId: types_common_1.NotEmptyStringSchema,\n    side: typebox_1.Type.Union([typebox_1.Type.Literal(\"left\"), typebox_1.Type.Literal(\"right\")]),\n    emotion: types_common_1.NotEmptyStringSchema,\n    characterName: types_common_1.NotEmptyStringSchema,\n    characterId: types_common_1.NotEmptyStringSchema,\n});\nconst DialogueSchema = typebox_1.Type.Object({\n    dialogueId: types_common_1.NotEmptyStringSchema,\n    lines: typebox_1.Type.Array(DialogueLineSchema),\n});\nexports.DialoguesConfigSchema = typebox_1.Type.Array(DialogueSchema);\n// --------------------- Dialogues End ------------------ //\n// -------------------- Constants ----------------- //\nvar ConstantKey;\n(function (ConstantKey) {\n    ConstantKey[\"gachaGemCost\"] = \"gachaGemCost\";\n    ConstantKey[\"gachaFreeClaimInterval\"] = \"gachaFreeClaimInterval\";\n    ConstantKey[\"heroesInBooster\"] = \"heroesInBooster\";\n    ConstantKey[\"maxTier\"] = \"maxTier\";\n    ConstantKey[\"idleMaxMinutes\"] = \"idleMaxMinutes\";\n    ConstantKey[\"huntLevelRequirments\"] = \"huntLevelRequirments\";\n    ConstantKey[\"idleRewardGold\"] = \"idleRewardGold\";\n    ConstantKey[\"idleRewardGreenMoonDrops\"] = \"idleRewardGreenMoonDrops\";\n    ConstantKey[\"idleRewardPurpleMoonDrops\"] = \"idleRewardPurpleMoonDrops\";\n    ConstantKey[\"idleRewardVSleep\"] = \"idleRewardVSleep\";\n    ConstantKey[\"starUpHeroCardCost\"] = \"starUpHeroCardCost\";\n    ConstantKey[\"referralsInvitedCountList\"] = \"referralsInvitedCountList\";\n    ConstantKey[\"referralsInvitedRewardFormula\"] = \"referralsInvitedRewardFormula\";\n    ConstantKey[\"referralsHuntCountFormula\"] = \"referralsHuntCountFormula\";\n    ConstantKey[\"referralsHuntRewardFormula\"] = \"referralsHuntRewardFormula\";\n})(ConstantKey || (exports.ConstantKey = ConstantKey = {}));\nexports.ConstantsStrings = [\n    ConstantKey.referralsInvitedCountList,\n    ConstantKey.referralsInvitedRewardFormula,\n    ConstantKey.referralsHuntCountFormula,\n    ConstantKey.referralsHuntRewardFormula,\n    ConstantKey.huntLevelRequirments,\n    ConstantKey.idleRewardGold,\n    ConstantKey.idleRewardGreenMoonDrops,\n    ConstantKey.idleRewardPurpleMoonDrops,\n    ConstantKey.idleRewardVSleep,\n    ConstantKey.starUpHeroCardCost,\n];\nexports.ConstantsNumber = Object.values(ConstantKey).filter((el) => exports.ConstantsStrings.every((e) => e !== el));\nexports.ConstantsConfigSchema = typebox_1.Type.Array(typebox_1.Type.Union([\n    typebox_1.Type.Object({\n        key: typebox_1.Type.Union(exports.ConstantsStrings.map((el) => typebox_1.Type.Literal(el))),\n        value: typebox_1.Type.String(),\n    }),\n    typebox_1.Type.Object({\n        key: typebox_1.Type.Union(exports.ConstantsNumber.map((el) => typebox_1.Type.Literal(el))),\n        value: typebox_1.Type.Number(),\n    }),\n]));\n// ------------- Constants End ----------------------- //\n// --------------- Drop Rules ------------------- //\nconst HeroNutDropRulesSchema = typebox_1.Type.Object({\n    heroRarity: typebox_1.Type.Array(typebox_1.Type.Object({\n        heroRarity: types_common_1.HeroRaritySchema,\n        weight: types_common_1.PosIntSchema,\n    })),\n});\nconst HeroCardDropRulesSchema = typebox_1.Type.Object({\n    heroRarity: typebox_1.Type.Array(typebox_1.Type.Object({\n        heroRarity: types_common_1.HeroRaritySchema,\n        weight: types_common_1.PosIntSchema,\n    })),\n});\nconst DefaultDropRulesSchema = typebox_1.Type.Object({\n    [types_enums_1.ResourceType.heroStarDust]: HeroNutDropRulesSchema, //TODO delete\n    [types_enums_1.ResourceType.heroCard]: HeroCardDropRulesSchema,\n});\n/* const DropRulesSchema = Type.Object({\n  [ResourceType.heroStarDust]: Type.Optional(HeroNutDropRulesSchema), //TODO delete\n  [ResourceType.heroCard]: Type.Optional(HeroCardDropRulesSchema),\n}); */\n// -------------------- Drop Rules End ------------ //\n// --------------------- Base -------------------------- //\nexports.HeroConfigSchema = typebox_1.Type.Object({\n    heroType: types_common_1.HeroTypeSchema,\n    name: typebox_1.Type.String(),\n    heroClass: types_common_1.HeroClassSchema,\n    heroRarity: types_common_1.HeroRaritySchema,\n    attack: types_common_1.NotEmptyStringSchema,\n    attackType: types_common_1.BattleAttackTypeSchema,\n    hp: types_common_1.NotEmptyStringSchema,\n    physicDefence: types_common_1.NotEmptyStringSchema,\n    magicDefence: types_common_1.NotEmptyStringSchema,\n    mastery: types_common_1.NotEmptyStringSchema,\n    gachable: typebox_1.Type.Boolean(),\n    attackRange: types_common_1.NonNegNumberSchema,\n    attackDelay: types_common_1.NonNegNumberSchema,\n    moveSpeed: types_common_1.NonNegNumberSchema,\n    ultimate: typebox_1.Type.Optional(types_common_1.NotEmptyStringSchema),\n    element: typebox_1.Type.String(),\n    power: types_common_1.NotEmptyStringSchema,\n});\nexports.HeroesConfigSchema = typebox_1.Type.Object({\n    heroes: typebox_1.Type.Array(exports.HeroConfigSchema),\n    ultimateAbilities: typebox_1.Type.Array(typebox_1.Type.Object({\n        ultimateType: types_common_1.NotEmptyStringSchema,\n        a: types_common_1.NotEmptyStringSchema,\n        b: types_common_1.NotEmptyStringSchema,\n        c: types_common_1.NotEmptyStringSchema,\n        d: types_common_1.NotEmptyStringSchema,\n        e: types_common_1.NotEmptyStringSchema,\n        f: types_common_1.NotEmptyStringSchema,\n        g: types_common_1.NotEmptyStringSchema,\n        h: types_common_1.NotEmptyStringSchema,\n        i: types_common_1.NotEmptyStringSchema,\n        j: types_common_1.NotEmptyStringSchema,\n    })),\n    leveling: typebox_1.Type.Object({\n        cost: typebox_1.Type.Object({\n            [types_enums_1.ResourceType.gold]: typebox_1.Type.Array(types_common_1.NonNegIntSchema),\n            [types_enums_1.ResourceType.greenMoonDrop]: typebox_1.Type.Array(types_common_1.NonNegIntSchema),\n            [types_enums_1.ResourceType.purpleMoonDrop]: typebox_1.Type.Array(types_common_1.NonNegIntSchema),\n        }),\n    }),\n});\nexports.BaseConfigSchema = typebox_1.Type.Object({\n    constants: exports.ConstantsConfigSchema,\n    playerDefaults: typebox_1.Type.Object({\n        xp: types_common_1.NonNegIntSchema,\n        gold: types_common_1.NonNegIntSchema,\n        gems: types_common_1.NonNegIntSchema,\n        gachaToken: types_common_1.NonNegIntSchema,\n        resources: typebox_1.Type.Object({\n            [types_enums_1.ResourceType.furniture]: typebox_1.Type.Array(types_common_1.FurnitureIdSchema),\n        }),\n        path: typebox_1.Type.Object({\n            pathIdx: types_common_1.NonNegIntSchema,\n            pathStep: types_common_1.NonNegIntSchema,\n        }),\n        hunt: typebox_1.Type.Object({\n            stage: types_common_1.NonNegIntSchema,\n        }),\n        heroes: typebox_1.Type.Array(typebox_1.Type.Object({\n            heroType: types_common_1.HeroTypeSchema,\n            level: types_common_1.PosIntSchema,\n            stars: types_common_1.PosIntSchema,\n        })),\n    }),\n    accountConfig: typebox_1.Type.Object({\n        xpPerLevel: typebox_1.Type.Array(types_common_1.NonNegIntSchema),\n    }),\n    heroesConfig: exports.HeroesConfigSchema,\n    rewardsConfig: typebox_1.Type.Object({\n        defaultDropRules: DefaultDropRulesSchema,\n        carouselRewards: typebox_1.Type.Array(exports.RewardConfigSchema),\n        dinoRoomRewards: typebox_1.Type.Object({\n            rare: typebox_1.Type.Array(typebox_1.Type.Object(RewardConfigContentFurnitureSchema)),\n            epic: typebox_1.Type.Array(typebox_1.Type.Object(RewardConfigContentFurnitureSchema)),\n            legendary: typebox_1.Type.Array(typebox_1.Type.Object(RewardConfigContentFurnitureSchema)),\n            paid: typebox_1.Type.Array(typebox_1.Type.Object(RewardConfigContentFurnitureSchema)),\n        }),\n    }),\n    shopConfig: typebox_1.Type.Object({\n        streakFreezeGemCost: types_common_1.PosIntSchema,\n    }),\n    sleepBoxConfig: typebox_1.Type.Array(typebox_1.Type.Object({\n        sleepBoxLevel: types_common_1.PosIntSchema,\n        rare: types_common_1.NonNegNumberSchema,\n        epic: types_common_1.NonNegNumberSchema,\n        legendary: types_common_1.NonNegNumberSchema,\n        hero1: types_common_1.NonNegNumberSchema,\n        hero2: types_common_1.NonNegNumberSchema,\n        hero3: types_common_1.NonNegNumberSchema,\n        hero4: types_common_1.NonNegNumberSchema,\n        hero5: types_common_1.NonNegNumberSchema,\n        hero6: types_common_1.NonNegNumberSchema,\n        hero7: types_common_1.NonNegNumberSchema,\n    })),\n    streakRewards: typebox_1.Type.Array(typebox_1.Type.Object({\n        streakDay: types_common_1.PosIntSchema,\n        reward: types_common_1.NotEmptyStringSchema,\n    })),\n});\n// --------------------- Base End --------------------- //\nexports.ConfigsRecordSchema = typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown());\n\n},{\"./types.common\":368,\"./types.enums\":370,\"@sinclair/typebox\":37}],370:[function(require,module,exports){\n\"use strict\";\n/** @module definitions */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PathType = exports.EquipmentRarity = exports.InventoryItemType = exports.GoEventType = exports.HiddenResourceType = exports.PathIdRegExp = exports.FurnitureIdRegExp = exports.ResourceType = exports.BoxType = exports.GameSessionValidationResult = void 0;\nvar GameSessionValidationResult;\n(function (GameSessionValidationResult) {\n    GameSessionValidationResult[\"ok\"] = \"ok\";\n    GameSessionValidationResult[\"mismatch\"] = \"mismatch\";\n    GameSessionValidationResult[\"failed\"] = \"failed\";\n})(GameSessionValidationResult || (exports.GameSessionValidationResult = GameSessionValidationResult = {}));\n/** @public */\nvar BoxType;\n(function (BoxType) {\n    BoxType[\"sleepBox\"] = \"sleepBox\";\n})(BoxType || (exports.BoxType = BoxType = {}));\n/** @public */\nvar ResourceType;\n(function (ResourceType) {\n    ResourceType[\"gold\"] = \"gold\";\n    ResourceType[\"gem\"] = \"gem\";\n    ResourceType[\"xp\"] = \"xp\";\n    ResourceType[\"purpleMoonDrop\"] = \"purpleMoonDrop\";\n    ResourceType[\"greenMoonDrop\"] = \"greenMoonDrop\";\n    ResourceType[\"gachaToken\"] = \"gachaToken\";\n    ResourceType[\"heroCard\"] = \"heroCard\";\n    ResourceType[\"heroStarDust\"] = \"heroStarDust\";\n    ResourceType[\"streakFreeze\"] = \"streakFreeze\";\n    ResourceType[\"furniture\"] = \"furniture\";\n    ResourceType[\"vSleep\"] = \"vSleep\";\n})(ResourceType || (exports.ResourceType = ResourceType = {}));\nexports.FurnitureIdRegExp = /(.+)_type_(\\d+)_lvl_(\\d+)/; // used for furnitureId validation\nexports.PathIdRegExp = /p(\\d+)[m,e]/;\n/** @public */\nvar HiddenResourceType;\n(function (HiddenResourceType) {\n    HiddenResourceType[\"carouselTicket\"] = \"carouselTicket\";\n})(HiddenResourceType || (exports.HiddenResourceType = HiddenResourceType = {}));\n/** @public */\nvar GoEventType;\n(function (GoEventType) {\n    GoEventType[\"battle\"] = \"battle\";\n    GoEventType[\"carousel\"] = \"carousel\";\n    GoEventType[\"dialogue\"] = \"dialogue\";\n    GoEventType[\"cutscene\"] = \"cutscene\";\n})(GoEventType || (exports.GoEventType = GoEventType = {}));\n/** @public */\nvar InventoryItemType;\n(function (InventoryItemType) {\n    InventoryItemType[\"resource\"] = \"resource\";\n})(InventoryItemType || (exports.InventoryItemType = InventoryItemType = {}));\n/** @public */\nvar EquipmentRarity;\n(function (EquipmentRarity) {\n    EquipmentRarity[EquipmentRarity[\"damaged\"] = 0] = \"damaged\";\n    EquipmentRarity[EquipmentRarity[\"common\"] = 1] = \"common\";\n    EquipmentRarity[EquipmentRarity[\"uncommon\"] = 2] = \"uncommon\";\n    EquipmentRarity[EquipmentRarity[\"rare\"] = 3] = \"rare\";\n    EquipmentRarity[EquipmentRarity[\"epic\"] = 4] = \"epic\";\n    EquipmentRarity[EquipmentRarity[\"legendary\"] = 5] = \"legendary\";\n})(EquipmentRarity || (exports.EquipmentRarity = EquipmentRarity = {}));\nvar PathType;\n(function (PathType) {\n    PathType[\"main\"] = \"m\";\n    PathType[\"extra\"] = \"e\";\n})(PathType || (exports.PathType = PathType = {}));\n\n},{}],371:[function(require,module,exports){\n\"use strict\";\n/* eslint-disable @typescript-eslint/strict-boolean-expressions */\n/*--------------------------------------------------------------------------\n\n@sinclair/typebox/format\n\nThe MIT License (MIT)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n---------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IsDateTime = exports.IsTime = exports.IsDate = void 0;\nconst DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DATE = /^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$/;\nfunction IsLeapYear(year) {\n    return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n/**\n * `[ajv-formats]` ISO8601 Date component\n * @example `2020-12-12`\n */\nfunction IsDate(value) {\n    const matches = DATE.exec(value);\n    if (!matches)\n        return false;\n    const year = +matches[1];\n    const month = +matches[2];\n    const day = +matches[3];\n    return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && IsLeapYear(year) ? 29 : DAYS[month]);\n}\nexports.IsDate = IsDate;\nconst TIME = /^(\\d\\d):(\\d\\d):(\\d\\d(?:\\.\\d+)?)(z|([+-])(\\d\\d)(?::?(\\d\\d))?)?$/i;\n/**\n * `[ajv-formats]` ISO8601 Time component\n * @example `20:20:39+00:00`\n */\nfunction IsTime(value, strictTimeZone) {\n    const matches = TIME.exec(value);\n    if (!matches)\n        return false;\n    const hr = +matches[1];\n    const min = +matches[2];\n    const sec = +matches[3];\n    const tz = matches[4];\n    const tzSign = matches[5] === \"-\" ? -1 : 1;\n    const tzH = +(matches[6] || 0);\n    const tzM = +(matches[7] || 0);\n    if (tzH > 23 || tzM > 59 || (strictTimeZone && !tz))\n        return false;\n    if (hr <= 23 && min <= 59 && sec < 60)\n        return true;\n    const utcMin = min - tzM * tzSign;\n    const utcHr = hr - tzH * tzSign - (utcMin < 0 ? 1 : 0);\n    return (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61;\n}\nexports.IsTime = IsTime;\nconst DATE_TIME_SEPARATOR = /t|\\s/i;\n/**\n * `[ajv-formats]` ISO8601 DateTime\n * @example `2020-12-12T20:20:40+00:00`\n */\nfunction IsDateTime(value, strictTimeZone) {\n    const dateTime = value.split(DATE_TIME_SEPARATOR);\n    return dateTime.length === 2 && IsDate(dateTime[0]) && IsTime(dateTime[1], strictTimeZone);\n}\nexports.IsDateTime = IsDateTime;\n\n},{}],372:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RESTToBundleOutputSchema = exports.SyncGameStateSchema = exports.HydratedGameStateSchema = exports.StoredGameStateSchema = exports.SleepStagesSchema = exports.InventoryResourceItemSchema = void 0;\n/** @module definitions */\nconst typebox_1 = require(\"@sinclair/typebox\");\nconst types_common_1 = require(\"./types.common\");\nconst types_configs_1 = require(\"./types.configs\");\nconst types_enums_1 = require(\"./types.enums\");\nconst types_1 = require(\"../client/types\");\nconst GameActionSchema = typebox_1.Type.Object({\n    type: typebox_1.Type.String(),\n    timestamp: types_common_1.TimestampMsSchema,\n    payload: typebox_1.Type.Unknown(),\n    result: typebox_1.Type.Unknown(),\n});\nconst InventoryResourceTypeSchema = typebox_1.Type.Union([\n    typebox_1.Type.Literal(types_enums_1.ResourceType.greenMoonDrop),\n    typebox_1.Type.Literal(types_enums_1.ResourceType.purpleMoonDrop),\n    typebox_1.Type.Literal(types_enums_1.ResourceType.gachaToken),\n    typebox_1.Type.Literal(types_enums_1.ResourceType.streakFreeze),\n]);\nexports.InventoryResourceItemSchema = typebox_1.Type.Object({\n    id: typebox_1.Type.String(),\n    itemType: typebox_1.Type.Literal(types_enums_1.InventoryItemType.resource),\n    amount: types_common_1.PosIntSchema,\n    payload: typebox_1.Type.Union([\n        typebox_1.Type.Object({\n            resourceType: InventoryResourceTypeSchema,\n        }),\n        typebox_1.Type.Object({\n            resourceType: typebox_1.Type.Literal(types_enums_1.ResourceType.heroCard),\n            heroType: types_common_1.HeroTypeSchema,\n        }),\n        typebox_1.Type.Object({\n            resourceType: typebox_1.Type.Literal(types_enums_1.ResourceType.heroStarDust),\n            heroRarity: types_common_1.HeroRaritySchema,\n        }),\n    ]),\n});\nconst InventoryItemSchema = typebox_1.Type.Union([exports.InventoryResourceItemSchema]);\n// -------------- SLEEP ------------------ //\nconst StreakTimellineSchema = typebox_1.Type.Array(typebox_1.Type.Object({\n    date: types_common_1.DateTimeStringSchema,\n    weekday: types_common_1.WeekdaySchema,\n    streakDay: typebox_1.Type.Optional(types_common_1.PosIntSchema),\n    frozen: typebox_1.Type.Optional(typebox_1.Type.Boolean()),\n    rewards: typebox_1.Type.Array(types_configs_1.ResourceRewardSchema),\n}));\nconst StreakSchema = typebox_1.Type.Object({\n    v2LastStreakDays: types_common_1.NonNegIntSchema,\n    currentStreakDays: types_common_1.NonNegIntSchema,\n    lastStreakDay: typebox_1.Type.Optional(types_common_1.DateTimeStringSchema),\n    streakTimeline: StreakTimellineSchema,\n    frozenDaysInRow: types_common_1.NonNegIntSchema,\n    restore: typebox_1.Type.Union([\n        typebox_1.Type.Object({\n            availible: typebox_1.Type.Literal(true),\n            daysToRestore: types_common_1.PosIntSchema,\n            streakTimeline: StreakTimellineSchema,\n            currentStreakDays: types_common_1.NonNegIntSchema,\n            v2LastStreakDays: types_common_1.NonNegIntSchema,\n            frozenDaysInRow: types_common_1.NonNegIntSchema,\n        }),\n        typebox_1.Type.Object({\n            availible: typebox_1.Type.Literal(false),\n        }),\n    ]),\n});\nconst SleepEventBaseSchema = typebox_1.Type.Object({\n    id: typebox_1.Type.String(),\n    createdAt: types_common_1.DateTimeStringSchema,\n});\nconst SleepStageSchema = typebox_1.Type.Object({\n    startTimestamp: typebox_1.Type.Number(),\n    endTimeStamp: typebox_1.Type.Number(),\n    type: typebox_1.Type.String(),\n});\nexports.SleepStagesSchema = typebox_1.Type.Array(SleepStageSchema);\nconst SleepEventPayloadBaseSchema = typebox_1.Type.Object({\n    sleepBoxLevel: typebox_1.Type.Number(),\n    rewards: typebox_1.Type.Array(types_configs_1.ResourceRewardSchema),\n    furniture: typebox_1.Type.Optional(typebox_1.Type.Array(types_configs_1.FurnitureRewardSchema)),\n    sleepDay: types_common_1.DateStringSchema,\n    tzOffsetSeconds: typebox_1.Type.Number(),\n    daysWithManualData: typebox_1.Type.Number(),\n    survey: typebox_1.Type.Object({\n        perceivedSleepQuality: typebox_1.Type.Optional(types_common_1.PerceivedSleepQualitySchema),\n    }),\n    stages: typebox_1.Type.Optional(exports.SleepStagesSchema),\n});\nconst ClaimOnlySleepEventSchema = typebox_1.Type.Composite([\n    SleepEventBaseSchema,\n    typebox_1.Type.Object({\n        eventType: typebox_1.Type.Literal(types_1.SleepClaimType.claimOnly),\n        payload: SleepEventPayloadBaseSchema,\n    }),\n]);\nconst SleepWithDataEventSchema = typebox_1.Type.Composite([\n    SleepEventBaseSchema,\n    typebox_1.Type.Object({\n        eventType: typebox_1.Type.Literal(types_1.SleepClaimType.regular),\n        payload: typebox_1.Type.Composite([\n            SleepEventPayloadBaseSchema,\n            typebox_1.Type.Object({\n                actualSleepDuration: typebox_1.Type.Number(),\n                goalSleepDuration: typebox_1.Type.Number(),\n                goToBedGoal: typebox_1.Type.String(),\n                wakeUpGoal: typebox_1.Type.String(),\n                sourceType: typebox_1.Type.String(),\n                sourceId: typebox_1.Type.String({ default: \"\" }),\n                goToBedDelta: typebox_1.Type.Number(),\n                wakeUpDelta: typebox_1.Type.Number(),\n            }),\n        ]),\n    }),\n]);\nconst SleepWithManualDataEventSchema = typebox_1.Type.Composite([\n    SleepEventBaseSchema,\n    typebox_1.Type.Object({\n        eventType: typebox_1.Type.Literal(types_1.SleepClaimType.manual),\n        payload: typebox_1.Type.Composite([\n            SleepEventPayloadBaseSchema,\n            typebox_1.Type.Object({\n                actualSleepDuration: typebox_1.Type.Number(),\n                goalSleepDuration: typebox_1.Type.Number(),\n                goToBedGoal: typebox_1.Type.String(),\n                wakeUpGoal: typebox_1.Type.String(),\n                goToBedDelta: typebox_1.Type.Number(),\n                wakeUpDelta: typebox_1.Type.Number(),\n            }),\n        ]),\n    }),\n]);\nconst SleepEventSchema = typebox_1.Type.Union([\n    ClaimOnlySleepEventSchema,\n    SleepWithDataEventSchema,\n    SleepWithManualDataEventSchema,\n]);\nconst SleepDataSchema = typebox_1.Type.Object({\n    sleepSchedule: typebox_1.Type.Object({\n        goToBed: typebox_1.Type.String(),\n        wakeUp: typebox_1.Type.String(),\n    }),\n    sleepScheduleUnset: typebox_1.Type.Boolean(),\n    nextDaySleepSchedule: typebox_1.Type.Optional(typebox_1.Type.Object({\n        goToBed: typebox_1.Type.String(),\n        wakeUp: typebox_1.Type.String(),\n    })),\n    streak: StreakSchema,\n    sleepEvents: typebox_1.Type.Array(SleepEventSchema),\n    lastClaimedAt: typebox_1.Type.Optional(types_common_1.DateTimeStringSchema),\n    lastClaimTzOffsetSeconds: typebox_1.Type.Optional(typebox_1.Type.Number()),\n    lastClaimResult: typebox_1.Type.Optional(typebox_1.Type.Object({\n        sleepBox: typebox_1.Type.Object({\n            level: typebox_1.Type.Number(),\n        }),\n        rewards: typebox_1.Type.Array(types_configs_1.ResourceRewardSchema),\n        daysWithManualData: typebox_1.Type.Optional(typebox_1.Type.Number()),\n        stages: typebox_1.Type.Optional(exports.SleepStagesSchema),\n        furniture: typebox_1.Type.Optional(typebox_1.Type.Array(types_configs_1.FurnitureRewardSchema)),\n    })),\n    lastSleepInfo: typebox_1.Type.Optional(typebox_1.Type.Object({\n        quality: types_common_1.SleepQualitySchema,\n        sleepPoints: typebox_1.Type.Optional(typebox_1.Type.Number()),\n        narrative: typebox_1.Type.Object({\n            title: typebox_1.Type.String(),\n            body: typebox_1.Type.String(),\n        }),\n        duration: typebox_1.Type.Optional(typebox_1.Type.Number()),\n        goToBedDelta: typebox_1.Type.Optional(typebox_1.Type.Number()),\n        wakeUpDelta: typebox_1.Type.Optional(typebox_1.Type.Number()),\n        survey: typebox_1.Type.Object({\n            perceivedSleepQuality: typebox_1.Type.Optional(types_common_1.PerceivedSleepQualitySchema),\n        }),\n    })),\n});\n// -------------- SLEEP END ------------------ //\n// -------------- Stored game state ------------//\nconst StoredPlayedSchema = typebox_1.Type.Object({\n    xp: types_common_1.NonNegIntSchema,\n    gold: types_common_1.NonNegIntSchema,\n    gems: types_common_1.NonNegIntSchema,\n    vSleep: types_common_1.NonNegIntSchema,\n    resources: typebox_1.Type.Object({\n        [types_enums_1.ResourceType.furniture]: typebox_1.Type.Array(types_common_1.FurnitureIdSchema),\n    }),\n    previouslyAddedFurniture: typebox_1.Type.Array(types_common_1.FurnitureIdSchema),\n    resourcesResidual: typebox_1.Type.Object({\n        [types_enums_1.ResourceType.gold]: typebox_1.Type.Number(),\n        [types_enums_1.ResourceType.greenMoonDrop]: typebox_1.Type.Number(),\n        [types_enums_1.ResourceType.purpleMoonDrop]: typebox_1.Type.Number(),\n        [types_enums_1.ResourceType.vSleep]: typebox_1.Type.Number({ default: 0 }),\n    }),\n    path: typebox_1.Type.Object({\n        pathIdx: types_common_1.NonNegIntSchema,\n        pathStep: types_common_1.NonNegIntSchema,\n        pathStage: typebox_1.Type.String(),\n        eventFinished: typebox_1.Type.Boolean(),\n    }),\n    heroes: typebox_1.Type.Array(typebox_1.Type.Object({\n        heroType: types_common_1.HeroTypeSchema,\n        level: types_common_1.PosIntSchema,\n        stars: types_common_1.PosIntSchema,\n    })),\n    inventory: typebox_1.Type.Array(InventoryItemSchema),\n    hidden: typebox_1.Type.Object({\n        [types_enums_1.HiddenResourceType.carouselTicket]: types_common_1.NonNegIntSchema,\n    }),\n    sleep: SleepDataSchema,\n    hunt: typebox_1.Type.Object({\n        stage: types_common_1.NonNegIntSchema,\n        startedAt: types_common_1.NonNegIntSchema,\n        history: typebox_1.Type.Array(typebox_1.Type.Object({\n            stage: types_common_1.NonNegIntSchema,\n            huntLevel: types_common_1.NonNegIntSchema,\n            startedAt: types_common_1.NonNegIntSchema,\n            finishedAt: types_common_1.NonNegIntSchema,\n        })),\n    }),\n    meta: typebox_1.Type.Object({\n        freeGachaLastClaim: types_common_1.NonNegIntSchema,\n        idlerLastClaim: types_common_1.NonNegIntSchema,\n        supporterPackPurchasedAt: typebox_1.Type.Optional(types_common_1.NonNegIntSchema),\n        solanaAddress: typebox_1.Type.Optional(typebox_1.Type.String()),\n        lastShareVSleepClaimDate: typebox_1.Type.Optional(types_common_1.NonNegIntSchema),\n    }),\n});\nconst StoredConfigIdsSchema = typebox_1.Type.Object({\n    currentPath: typebox_1.Type.String(),\n    nextPath: typebox_1.Type.String(),\n    battles: typebox_1.Type.String(),\n    hunt: typebox_1.Type.String(),\n    rewards: typebox_1.Type.String(),\n    dialogues: typebox_1.Type.String(),\n    base: typebox_1.Type.String(),\n});\nconst StoredGameStateBaseSchema = typebox_1.Type.Object({\n    _schemaVersion: types_common_1.PosIntSchema,\n    _configIds: StoredConfigIdsSchema,\n    player: StoredPlayedSchema,\n});\nconst StoredGameStateV1Schema = typebox_1.Type.Composite([\n    StoredGameStateBaseSchema,\n    typebox_1.Type.Object({\n        _dataVersion: types_common_1.NonNegIntSchema,\n        _currentRngSeed: types_common_1.RngSeedSchema,\n        startedTimestampMs: types_common_1.TimestampMsSchema,\n        _sessions: typebox_1.Type.Unsafe(typebox_1.Type.Any()),\n    }),\n]);\nexports.StoredGameStateSchema = typebox_1.Type.Union([StoredGameStateV1Schema]);\n// -------------- Stored game state END ---------//\nexports.HydratedGameStateSchema = typebox_1.Type.Object({\n    _dataVersion: types_common_1.NonNegIntSchema,\n    _schemaVersion: types_common_1.PosIntSchema,\n    startedTimestampMs: types_common_1.TimestampMsSchema,\n    player: typebox_1.Type.Composite([\n        StoredPlayedSchema,\n        typebox_1.Type.Object({\n            // sometimes user referred as a number, sometimes as a string. This must be fixed some day, but String is safe at the moment\n            // default is \"0\" since old states on the application side are not having userId property at all\n            userId: typebox_1.Type.String({ default: \"0\" }),\n            username: typebox_1.Type.String(),\n            meta: typebox_1.Type.Object({\n                freeGachaLastClaim: types_common_1.NonNegIntSchema,\n                idlerLastClaim: types_common_1.NonNegIntSchema,\n                supporterPackPurchasedAt: typebox_1.Type.Optional(types_common_1.NonNegIntSchema),\n                solanaAddress: typebox_1.Type.Optional(typebox_1.Type.String()),\n                isReferral: typebox_1.Type.Optional(typebox_1.Type.Boolean()),\n                lastShareVSleepClaimDate: typebox_1.Type.Optional(types_common_1.NonNegIntSchema),\n            }),\n        }),\n    ]),\n    _configIds: typebox_1.Type.Object({\n        currentPath: typebox_1.Type.String(),\n        nextPath: typebox_1.Type.String(),\n        battles: typebox_1.Type.String(),\n        hunt: typebox_1.Type.String(),\n        rewards: typebox_1.Type.String(),\n        dialogues: typebox_1.Type.String(),\n        base: typebox_1.Type.String(),\n    }),\n    _configs: typebox_1.Type.Object({\n        currentPath: typebox_1.Type.Optional(types_configs_1.PathConfigSchema),\n        nextPath: typebox_1.Type.Optional(types_configs_1.PathConfigSchema),\n        battles: typebox_1.Type.Optional(types_configs_1.BattlesConfigSchema),\n        rewards: typebox_1.Type.Optional(types_configs_1.RewardConfigFileSchema),\n        hunt: typebox_1.Type.Optional(types_configs_1.HuntConfigSchema),\n        dialogues: typebox_1.Type.Optional(types_configs_1.DialoguesConfigSchema),\n        base: typebox_1.Type.Optional(types_configs_1.BaseConfigSchema),\n    }),\n    _init: typebox_1.Type.Object({\n        rng: typebox_1.Type.Object({\n            seed: types_common_1.RngSeedSchema,\n        }),\n    }),\n    appliedActions: typebox_1.Type.Optional(typebox_1.Type.Array(GameActionSchema)),\n    envConfig: typebox_1.Type.Optional(typebox_1.Type.Object({\n        isActionsLogEnabled: typebox_1.Type.Boolean(),\n    })),\n});\nexports.SyncGameStateSchema = typebox_1.Type.Omit(exports.HydratedGameStateSchema, [\"_configs\"]);\n/** @public */\nexports.RESTToBundleOutputSchema = typebox_1.Type.Object({\n    update: typebox_1.Type.Object({\n        freeGachaLastClaim: typebox_1.Type.Optional(typebox_1.Type.Number()),\n        username: typebox_1.Type.Optional(typebox_1.Type.String()),\n        supporterPackPurchasedAt: typebox_1.Type.Optional(typebox_1.Type.Number()),\n        solanaAddress: typebox_1.Type.Optional(typebox_1.Type.String()),\n        isReferral: typebox_1.Type.Optional(typebox_1.Type.Boolean()),\n        lastShareVSleepClaimDate: typebox_1.Type.Optional(typebox_1.Type.Number()),\n        currentStreakDays: typebox_1.Type.Optional(typebox_1.Type.Number()),\n    }),\n    spend: typebox_1.Type.Object({\n        [types_enums_1.ResourceType.gem]: typebox_1.Type.Optional(typebox_1.Type.String()),\n        [types_enums_1.ResourceType.gold]: typebox_1.Type.Optional(typebox_1.Type.String()),\n        [types_enums_1.ResourceType.gachaToken]: typebox_1.Type.Optional(typebox_1.Type.String()),\n        [types_enums_1.ResourceType.xp]: typebox_1.Type.Optional(typebox_1.Type.String()),\n        [types_enums_1.ResourceType.purpleMoonDrop]: typebox_1.Type.Optional(typebox_1.Type.String()),\n        [types_enums_1.ResourceType.greenMoonDrop]: typebox_1.Type.Optional(typebox_1.Type.String()),\n        [types_enums_1.ResourceType.heroStarDust]: typebox_1.Type.Optional(typebox_1.Type.String()),\n        [types_enums_1.ResourceType.streakFreeze]: typebox_1.Type.Optional(typebox_1.Type.String()),\n        [types_enums_1.ResourceType.heroCard]: typebox_1.Type.Optional(typebox_1.Type.Null()),\n        [types_enums_1.ResourceType.furniture]: typebox_1.Type.Optional(typebox_1.Type.Null()),\n        [types_enums_1.ResourceType.vSleep]: typebox_1.Type.Optional(typebox_1.Type.String()),\n    }),\n    add: typebox_1.Type.Object({\n        [types_enums_1.ResourceType.heroCard]: typebox_1.Type.Optional(typebox_1.Type.Partial(typebox_1.Type.Record(types_common_1.HeroTypeSchema, typebox_1.Type.String()))),\n        [types_enums_1.ResourceType.furniture]: typebox_1.Type.Optional(typebox_1.Type.Array(types_common_1.FurnitureIdSchema)),\n        [types_enums_1.ResourceType.gem]: typebox_1.Type.Optional(typebox_1.Type.String()),\n        [types_enums_1.ResourceType.gold]: typebox_1.Type.Optional(typebox_1.Type.String()),\n        [types_enums_1.ResourceType.gachaToken]: typebox_1.Type.Optional(typebox_1.Type.String()),\n        [types_enums_1.ResourceType.xp]: typebox_1.Type.Optional(typebox_1.Type.String()),\n        [types_enums_1.ResourceType.purpleMoonDrop]: typebox_1.Type.Optional(typebox_1.Type.String()),\n        [types_enums_1.ResourceType.greenMoonDrop]: typebox_1.Type.Optional(typebox_1.Type.String()),\n        [types_enums_1.ResourceType.heroStarDust]: typebox_1.Type.Optional(typebox_1.Type.String()),\n        [types_enums_1.ResourceType.streakFreeze]: typebox_1.Type.Optional(typebox_1.Type.String()),\n        [types_enums_1.ResourceType.vSleep]: typebox_1.Type.Optional(typebox_1.Type.String()),\n        // TODO: Remove after implementing nested parsing of RESTToBundleOutput objects on Unity side:\n        extras_redeem_code_supporter_pack: typebox_1.Type.Optional(typebox_1.Type.String()), // used for redeem code supporter pack\n    }),\n});\n\n},{\"../client/types\":356,\"./types.common\":368,\"./types.configs\":369,\"./types.enums\":370,\"@sinclair/typebox\":37}],373:[function(require,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RESTToBundleOutputGuard = exports.NonNegIntGuard = exports.InventoryResourceItemGuard = exports.ConfigRecordValidator = exports.SleepStagesValidator = exports.PathIdValidator = exports.PathIdGuard = exports.HeroesConfigValidator = exports.PathConfigValidator = exports.RewardConfigValidator = exports.HuntConfigValidator = exports.DialoguesConfigValidator = exports.BattlesConfigValidator = exports.BaseConfigValidator = exports.SyncGameStateGuard = exports.SyncGameStateValidator = exports.HydratedGameStateValidator = exports.StoredGameStateValidator = void 0;\nconst types_schemas_1 = require(\"./types.schemas\");\nconst types_configs_1 = require(\"./types.configs\");\nconst schemaValidation_1 = require(\"../services/schemaValidation\");\nconst types_common_1 = require(\"./types.common\");\nexports.StoredGameStateValidator = (0, schemaValidation_1.generateValidator)(types_schemas_1.StoredGameStateSchema);\nexports.HydratedGameStateValidator = (0, schemaValidation_1.generateValidator)(types_schemas_1.HydratedGameStateSchema);\nexports.SyncGameStateValidator = (0, schemaValidation_1.generateValidator)(types_schemas_1.SyncGameStateSchema);\nexports.SyncGameStateGuard = (0, schemaValidation_1.generateGuard)(types_schemas_1.SyncGameStateSchema);\nexports.BaseConfigValidator = (0, schemaValidation_1.generateValidator)(types_configs_1.BaseConfigSchema);\nexports.BattlesConfigValidator = (0, schemaValidation_1.generateValidator)(types_configs_1.BattlesConfigSchema);\nexports.DialoguesConfigValidator = (0, schemaValidation_1.generateValidator)(types_configs_1.DialoguesConfigSchema);\nexports.HuntConfigValidator = (0, schemaValidation_1.generateValidator)(types_configs_1.HuntConfigSchema);\nexports.RewardConfigValidator = (0, schemaValidation_1.generateValidator)(types_configs_1.RewardConfigFileSchema);\nexports.PathConfigValidator = (0, schemaValidation_1.generateValidator)(types_configs_1.PathConfigSchema);\nexports.HeroesConfigValidator = (0, schemaValidation_1.generateValidator)(types_configs_1.HeroesConfigSchema);\nexports.PathIdGuard = (0, schemaValidation_1.generateGuard)(types_configs_1.PathIdSchema);\nexports.PathIdValidator = (0, schemaValidation_1.generateValidator)(types_configs_1.PathIdSchema);\nexports.SleepStagesValidator = (0, schemaValidation_1.generateValidator)(types_schemas_1.SleepStagesSchema);\nexports.ConfigRecordValidator = (0, schemaValidation_1.generateValidator)(types_configs_1.ConfigsRecordSchema);\nexports.InventoryResourceItemGuard = (0, schemaValidation_1.generateGuard)(types_schemas_1.InventoryResourceItemSchema);\nexports.NonNegIntGuard = (0, schemaValidation_1.generateGuard)(types_common_1.NonNegIntSchema);\nexports.RESTToBundleOutputGuard = (0, schemaValidation_1.generateGuard)(types_schemas_1.RESTToBundleOutputSchema);\n\n},{\"../services/schemaValidation\":366,\"./types.common\":368,\"./types.configs\":369,\"./types.schemas\":372}]},{},[337]);\n"}