{"ast":null,"code":"/*! *****************************************************************************\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\n(function (Reflect) {\n  // Metadata Proposal\n  // https://rbuckton.github.io/reflect-metadata/\n  (function (factory) {\n    var root = typeof global === \"object\" ? global : typeof self === \"object\" ? self : typeof this === \"object\" ? this : Function(\"return this;\")();\n    var exporter = makeExporter(Reflect);\n\n    if (typeof root.Reflect === \"undefined\") {\n      root.Reflect = Reflect;\n    } else {\n      exporter = makeExporter(root.Reflect, exporter);\n    }\n\n    factory(exporter);\n\n    function makeExporter(target, previous) {\n      return function (key, value) {\n        if (typeof target[key] !== \"function\") {\n          Object.defineProperty(target, key, {\n            configurable: true,\n            writable: true,\n            value: value\n          });\n        }\n\n        if (previous) previous(key, value);\n      };\n    }\n  })(function (exporter) {\n    var hasOwn = Object.prototype.hasOwnProperty; // feature test for Symbol support\n\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\n    var supportsProto = {\n      __proto__: []\n    } instanceof Array; // feature test for __proto__ support\n\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 ? function () {\n        return MakeDictionary(Object.create(null));\n      } : supportsProto ? function () {\n        return MakeDictionary({\n          __proto__: null\n        });\n      } : function () {\n        return MakeDictionary({});\n      },\n      has: downLevel ? function (map, key) {\n        return hasOwn.call(map, key);\n      } : function (map, key) {\n        return key in map;\n      },\n      get: downLevel ? function (map, key) {\n        return hasOwn.call(map, key) ? map[key] : undefined;\n      } : function (map, key) {\n        return map[key];\n      }\n    }; // Load global or shim versions of Map, Set, and WeakMap\n\n    var functionPrototype = Object.getPrototypeOf(Function);\n    var usePolyfill = typeof process === \"object\" && process.env && process.env[\"REFLECT_METADATA_USE_MAP_POLYFILL\"] === \"true\";\n\n    var _Map = !usePolyfill && typeof Map === \"function\" && typeof Map.prototype.entries === \"function\" ? Map : CreateMapPolyfill();\n\n    var _Set = !usePolyfill && typeof Set === \"function\" && typeof Set.prototype.entries === \"function\" ? Set : CreateSetPolyfill();\n\n    var _WeakMap = !usePolyfill && typeof WeakMap === \"function\" ? WeakMap : CreateWeakMapPolyfill(); // [[Metadata]] internal slot\n    // https://rbuckton.github.io/reflect-metadata/#ordinary-object-internal-methods-and-internal-slots\n\n\n    var Metadata = new _WeakMap();\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\n    function decorate(decorators, target, propertyKey, attributes) {\n      if (!IsUndefined(propertyKey)) {\n        if (!IsArray(decorators)) throw new TypeError();\n        if (!IsObject(target)) throw new TypeError();\n        if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes)) throw new TypeError();\n        if (IsNull(attributes)) attributes = undefined;\n        propertyKey = ToPropertyKey(propertyKey);\n        return DecorateProperty(decorators, target, propertyKey, attributes);\n      } else {\n        if (!IsArray(decorators)) throw new TypeError();\n        if (!IsConstructor(target)) throw new TypeError();\n        return DecorateConstructor(decorators, target);\n      }\n    }\n\n    exporter(\"decorate\", decorate); // 4.1.2 Reflect.metadata(metadataKey, metadataValue)\n    // https://rbuckton.github.io/reflect-metadata/#reflect.metadata\n\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\n    function metadata(metadataKey, metadataValue) {\n      function decorator(target, propertyKey) {\n        if (!IsObject(target)) throw new TypeError();\n        if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey)) throw new TypeError();\n        OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n      }\n\n      return decorator;\n    }\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\n    function defineMetadata(metadataKey, metadataValue, target, propertyKey) {\n      if (!IsObject(target)) throw new TypeError();\n      if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);\n      return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n    }\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\n    function hasMetadata(metadataKey, target, propertyKey) {\n      if (!IsObject(target)) throw new TypeError();\n      if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);\n      return OrdinaryHasMetadata(metadataKey, target, propertyKey);\n    }\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\n    function hasOwnMetadata(metadataKey, target, propertyKey) {\n      if (!IsObject(target)) throw new TypeError();\n      if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);\n      return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);\n    }\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\n    function getMetadata(metadataKey, target, propertyKey) {\n      if (!IsObject(target)) throw new TypeError();\n      if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);\n      return OrdinaryGetMetadata(metadataKey, target, propertyKey);\n    }\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\n    function getOwnMetadata(metadataKey, target, propertyKey) {\n      if (!IsObject(target)) throw new TypeError();\n      if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);\n      return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);\n    }\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\n    function getMetadataKeys(target, propertyKey) {\n      if (!IsObject(target)) throw new TypeError();\n      if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);\n      return OrdinaryMetadataKeys(target, propertyKey);\n    }\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\n    function getOwnMetadataKeys(target, propertyKey) {\n      if (!IsObject(target)) throw new TypeError();\n      if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);\n      return OrdinaryOwnMetadataKeys(target, propertyKey);\n    }\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\n    function deleteMetadata(metadataKey, target, propertyKey) {\n      if (!IsObject(target)) throw new TypeError();\n      if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);\n      var metadataMap = GetOrCreateMetadataMap(target, propertyKey,\n      /*Create*/\n      false);\n      if (IsUndefined(metadataMap)) return false;\n      if (!metadataMap.delete(metadataKey)) return false;\n      if (metadataMap.size > 0) return true;\n      var targetMetadata = Metadata.get(target);\n      targetMetadata.delete(propertyKey);\n      if (targetMetadata.size > 0) return true;\n      Metadata.delete(target);\n      return true;\n    }\n\n    exporter(\"deleteMetadata\", deleteMetadata);\n\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\n        if (!IsUndefined(decorated) && !IsNull(decorated)) {\n          if (!IsConstructor(decorated)) throw new TypeError();\n          target = decorated;\n        }\n      }\n\n      return target;\n    }\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\n        if (!IsUndefined(decorated) && !IsNull(decorated)) {\n          if (!IsObject(decorated)) throw new TypeError();\n          descriptor = decorated;\n        }\n      }\n\n      return descriptor;\n    }\n\n    function GetOrCreateMetadataMap(O, P, Create) {\n      var targetMetadata = Metadata.get(O);\n\n      if (IsUndefined(targetMetadata)) {\n        if (!Create) return undefined;\n        targetMetadata = new _Map();\n        Metadata.set(O, targetMetadata);\n      }\n\n      var metadataMap = targetMetadata.get(P);\n\n      if (IsUndefined(metadataMap)) {\n        if (!Create) return undefined;\n        metadataMap = new _Map();\n        targetMetadata.set(P, metadataMap);\n      }\n\n      return metadataMap;\n    } // 3.1.1.1 OrdinaryHasMetadata(MetadataKey, O, P)\n    // https://rbuckton.github.io/reflect-metadata/#ordinaryhasmetadata\n\n\n    function OrdinaryHasMetadata(MetadataKey, O, P) {\n      var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n      if (hasOwn) return true;\n      var parent = OrdinaryGetPrototypeOf(O);\n      if (!IsNull(parent)) return OrdinaryHasMetadata(MetadataKey, parent, P);\n      return false;\n    } // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)\n    // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata\n\n\n    function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\n      var metadataMap = GetOrCreateMetadataMap(O, P,\n      /*Create*/\n      false);\n      if (IsUndefined(metadataMap)) return false;\n      return ToBoolean(metadataMap.has(MetadataKey));\n    } // 3.1.3.1 OrdinaryGetMetadata(MetadataKey, O, P)\n    // https://rbuckton.github.io/reflect-metadata/#ordinarygetmetadata\n\n\n    function OrdinaryGetMetadata(MetadataKey, O, P) {\n      var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n      if (hasOwn) return OrdinaryGetOwnMetadata(MetadataKey, O, P);\n      var parent = OrdinaryGetPrototypeOf(O);\n      if (!IsNull(parent)) return OrdinaryGetMetadata(MetadataKey, parent, P);\n      return undefined;\n    } // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)\n    // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata\n\n\n    function OrdinaryGetOwnMetadata(MetadataKey, O, P) {\n      var metadataMap = GetOrCreateMetadataMap(O, P,\n      /*Create*/\n      false);\n      if (IsUndefined(metadataMap)) return undefined;\n      return metadataMap.get(MetadataKey);\n    } // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)\n    // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata\n\n\n    function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {\n      var metadataMap = GetOrCreateMetadataMap(O, P,\n      /*Create*/\n      true);\n      metadataMap.set(MetadataKey, MetadataValue);\n    } // 3.1.6.1 OrdinaryMetadataKeys(O, P)\n    // https://rbuckton.github.io/reflect-metadata/#ordinarymetadatakeys\n\n\n    function OrdinaryMetadataKeys(O, P) {\n      var ownKeys = OrdinaryOwnMetadataKeys(O, P);\n      var parent = OrdinaryGetPrototypeOf(O);\n      if (parent === null) return ownKeys;\n      var parentKeys = OrdinaryMetadataKeys(parent, P);\n      if (parentKeys.length <= 0) return ownKeys;\n      if (ownKeys.length <= 0) return parentKeys;\n      var set = new _Set();\n      var keys = [];\n\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\n        if (!hasKey) {\n          set.add(key);\n          keys.push(key);\n        }\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\n        if (!hasKey) {\n          set.add(key);\n          keys.push(key);\n        }\n      }\n\n      return keys;\n    } // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)\n    // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys\n\n\n    function OrdinaryOwnMetadataKeys(O, P) {\n      var keys = [];\n      var metadataMap = GetOrCreateMetadataMap(O, P,\n      /*Create*/\n      false);\n      if (IsUndefined(metadataMap)) return keys;\n      var keysObj = metadataMap.keys();\n      var iterator = GetIterator(keysObj);\n      var k = 0;\n\n      while (true) {\n        var next = IteratorStep(iterator);\n\n        if (!next) {\n          keys.length = k;\n          return keys;\n        }\n\n        var nextValue = IteratorValue(next);\n\n        try {\n          keys[k] = nextValue;\n        } catch (e) {\n          try {\n            IteratorClose(iterator);\n          } finally {\n            throw e;\n          }\n        }\n\n        k++;\n      }\n    } // 6 ECMAScript Data Typ0es and Values\n    // https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values\n\n\n    function Type(x) {\n      if (x === null) return 1\n      /* Null */\n      ;\n\n      switch (typeof x) {\n        case \"undefined\":\n          return 0\n          /* Undefined */\n          ;\n\n        case \"boolean\":\n          return 2\n          /* Boolean */\n          ;\n\n        case \"string\":\n          return 3\n          /* String */\n          ;\n\n        case \"symbol\":\n          return 4\n          /* Symbol */\n          ;\n\n        case \"number\":\n          return 5\n          /* Number */\n          ;\n\n        case \"object\":\n          return x === null ? 1\n          /* Null */\n          : 6\n          /* Object */\n          ;\n\n        default:\n          return 6\n          /* Object */\n          ;\n      }\n    } // 6.1.1 The Undefined Type\n    // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-undefined-type\n\n\n    function IsUndefined(x) {\n      return x === undefined;\n    } // 6.1.2 The Null Type\n    // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-null-type\n\n\n    function IsNull(x) {\n      return x === null;\n    } // 6.1.5 The Symbol Type\n    // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-symbol-type\n\n\n    function IsSymbol(x) {\n      return typeof x === \"symbol\";\n    } // 6.1.7 The Object Type\n    // https://tc39.github.io/ecma262/#sec-object-type\n\n\n    function IsObject(x) {\n      return typeof x === \"object\" ? x !== null : typeof x === \"function\";\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\n\n    function ToPrimitive(input, PreferredType) {\n      switch (Type(input)) {\n        case 0\n        /* Undefined */\n        :\n          return input;\n\n        case 1\n        /* Null */\n        :\n          return input;\n\n        case 2\n        /* Boolean */\n        :\n          return input;\n\n        case 3\n        /* String */\n        :\n          return input;\n\n        case 4\n        /* Symbol */\n        :\n          return input;\n\n        case 5\n        /* Number */\n        :\n          return input;\n      }\n\n      var hint = PreferredType === 3\n      /* String */\n      ? \"string\" : PreferredType === 5\n      /* Number */\n      ? \"number\" : \"default\";\n      var exoticToPrim = GetMethod(input, toPrimitiveSymbol);\n\n      if (exoticToPrim !== undefined) {\n        var result = exoticToPrim.call(input, hint);\n        if (IsObject(result)) throw new TypeError();\n        return result;\n      }\n\n      return OrdinaryToPrimitive(input, hint === \"default\" ? \"number\" : hint);\n    } // 7.1.1.1 OrdinaryToPrimitive(O, hint)\n    // https://tc39.github.io/ecma262/#sec-ordinarytoprimitive\n\n\n    function OrdinaryToPrimitive(O, hint) {\n      if (hint === \"string\") {\n        var toString_1 = O.toString;\n\n        if (IsCallable(toString_1)) {\n          var result = toString_1.call(O);\n          if (!IsObject(result)) return result;\n        }\n\n        var valueOf = O.valueOf;\n\n        if (IsCallable(valueOf)) {\n          var result = valueOf.call(O);\n          if (!IsObject(result)) return result;\n        }\n      } else {\n        var valueOf = O.valueOf;\n\n        if (IsCallable(valueOf)) {\n          var result = valueOf.call(O);\n          if (!IsObject(result)) return result;\n        }\n\n        var toString_2 = O.toString;\n\n        if (IsCallable(toString_2)) {\n          var result = toString_2.call(O);\n          if (!IsObject(result)) return result;\n        }\n      }\n\n      throw new TypeError();\n    } // 7.1.2 ToBoolean(argument)\n    // https://tc39.github.io/ecma262/2016/#sec-toboolean\n\n\n    function ToBoolean(argument) {\n      return !!argument;\n    } // 7.1.12 ToString(argument)\n    // https://tc39.github.io/ecma262/#sec-tostring\n\n\n    function ToString(argument) {\n      return \"\" + argument;\n    } // 7.1.14 ToPropertyKey(argument)\n    // https://tc39.github.io/ecma262/#sec-topropertykey\n\n\n    function ToPropertyKey(argument) {\n      var key = ToPrimitive(argument, 3\n      /* String */\n      );\n      if (IsSymbol(key)) return key;\n      return ToString(key);\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\n\n    function IsArray(argument) {\n      return Array.isArray ? Array.isArray(argument) : argument instanceof Object ? argument instanceof Array : Object.prototype.toString.call(argument) === \"[object Array]\";\n    } // 7.2.3 IsCallable(argument)\n    // https://tc39.github.io/ecma262/#sec-iscallable\n\n\n    function IsCallable(argument) {\n      // NOTE: This is an approximation as we cannot check for [[Call]] internal method.\n      return typeof argument === \"function\";\n    } // 7.2.4 IsConstructor(argument)\n    // https://tc39.github.io/ecma262/#sec-isconstructor\n\n\n    function IsConstructor(argument) {\n      // NOTE: This is an approximation as we cannot check for [[Construct]] internal method.\n      return typeof argument === \"function\";\n    } // 7.2.7 IsPropertyKey(argument)\n    // https://tc39.github.io/ecma262/#sec-ispropertykey\n\n\n    function IsPropertyKey(argument) {\n      switch (Type(argument)) {\n        case 3\n        /* String */\n        :\n          return true;\n\n        case 4\n        /* Symbol */\n        :\n          return true;\n\n        default:\n          return false;\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\n\n    function GetMethod(V, P) {\n      var func = V[P];\n      if (func === undefined || func === null) return undefined;\n      if (!IsCallable(func)) throw new TypeError();\n      return func;\n    } // 7.4 Operations on Iterator Objects\n    // https://tc39.github.io/ecma262/#sec-operations-on-iterator-objects\n\n\n    function GetIterator(obj) {\n      var method = GetMethod(obj, iteratorSymbol);\n      if (!IsCallable(method)) throw new TypeError(); // from Call\n\n      var iterator = method.call(obj);\n      if (!IsObject(iterator)) throw new TypeError();\n      return iterator;\n    } // 7.4.4 IteratorValue(iterResult)\n    // https://tc39.github.io/ecma262/2016/#sec-iteratorvalue\n\n\n    function IteratorValue(iterResult) {\n      return iterResult.value;\n    } // 7.4.5 IteratorStep(iterator)\n    // https://tc39.github.io/ecma262/#sec-iteratorstep\n\n\n    function IteratorStep(iterator) {\n      var result = iterator.next();\n      return result.done ? false : result;\n    } // 7.4.6 IteratorClose(iterator, completion)\n    // https://tc39.github.io/ecma262/#sec-iteratorclose\n\n\n    function IteratorClose(iterator) {\n      var f = iterator[\"return\"];\n      if (f) f.call(iterator);\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\n\n    function OrdinaryGetPrototypeOf(O) {\n      var proto = Object.getPrototypeOf(O);\n      if (typeof O !== \"function\" || O === functionPrototype) return proto; // 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\n      if (proto !== functionPrototype) return proto; // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n\n      var prototype = O.prototype;\n      var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n      if (prototypeProto == null || prototypeProto === Object.prototype) return proto; // If the constructor was not a function, then we cannot determine the heritage.\n\n      var constructor = prototypeProto.constructor;\n      if (typeof constructor !== \"function\") return proto; // If we have some kind of self-reference, then we cannot determine the heritage.\n\n      if (constructor === O) return proto; // we have a pretty good guess at the heritage.\n\n      return constructor;\n    } // naive Map shim\n\n\n    function CreateMapPolyfill() {\n      var cacheSentinel = {};\n      var arraySentinel = [];\n\n      var MapIterator =\n      /** @class */\n      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\n        MapIterator.prototype[\"@@iterator\"] = function () {\n          return this;\n        };\n\n        MapIterator.prototype[iteratorSymbol] = function () {\n          return this;\n        };\n\n        MapIterator.prototype.next = function () {\n          var index = this._index;\n\n          if (index >= 0 && index < this._keys.length) {\n            var result = this._selector(this._keys[index], this._values[index]);\n\n            if (index + 1 >= this._keys.length) {\n              this._index = -1;\n              this._keys = arraySentinel;\n              this._values = arraySentinel;\n            } else {\n              this._index++;\n            }\n\n            return {\n              value: result,\n              done: false\n            };\n          }\n\n          return {\n            value: undefined,\n            done: true\n          };\n        };\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\n          throw error;\n        };\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\n          return {\n            value: value,\n            done: true\n          };\n        };\n\n        return MapIterator;\n      }();\n\n      return (\n        /** @class */\n        function () {\n          function Map() {\n            this._keys = [];\n            this._values = [];\n            this._cacheKey = cacheSentinel;\n            this._cacheIndex = -2;\n          }\n\n          Object.defineProperty(Map.prototype, \"size\", {\n            get: function () {\n              return this._keys.length;\n            },\n            enumerable: true,\n            configurable: true\n          });\n\n          Map.prototype.has = function (key) {\n            return this._find(key,\n            /*insert*/\n            false) >= 0;\n          };\n\n          Map.prototype.get = function (key) {\n            var index = this._find(key,\n            /*insert*/\n            false);\n\n            return index >= 0 ? this._values[index] : undefined;\n          };\n\n          Map.prototype.set = function (key, value) {\n            var index = this._find(key,\n            /*insert*/\n            true);\n\n            this._values[index] = value;\n            return this;\n          };\n\n          Map.prototype.delete = function (key) {\n            var index = this._find(key,\n            /*insert*/\n            false);\n\n            if (index >= 0) {\n              var size = this._keys.length;\n\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\n              this._keys.length--;\n              this._values.length--;\n\n              if (key === this._cacheKey) {\n                this._cacheKey = cacheSentinel;\n                this._cacheIndex = -2;\n              }\n\n              return true;\n            }\n\n            return false;\n          };\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\n          Map.prototype.keys = function () {\n            return new MapIterator(this._keys, this._values, getKey);\n          };\n\n          Map.prototype.values = function () {\n            return new MapIterator(this._keys, this._values, getValue);\n          };\n\n          Map.prototype.entries = function () {\n            return new MapIterator(this._keys, this._values, getEntry);\n          };\n\n          Map.prototype[\"@@iterator\"] = function () {\n            return this.entries();\n          };\n\n          Map.prototype[iteratorSymbol] = function () {\n            return this.entries();\n          };\n\n          Map.prototype._find = function (key, insert) {\n            if (this._cacheKey !== key) {\n              this._cacheIndex = this._keys.indexOf(this._cacheKey = key);\n            }\n\n            if (this._cacheIndex < 0 && insert) {\n              this._cacheIndex = this._keys.length;\n\n              this._keys.push(key);\n\n              this._values.push(undefined);\n            }\n\n            return this._cacheIndex;\n          };\n\n          return Map;\n        }()\n      );\n\n      function getKey(key, _) {\n        return key;\n      }\n\n      function getValue(_, value) {\n        return value;\n      }\n\n      function getEntry(key, value) {\n        return [key, value];\n      }\n    } // naive Set shim\n\n\n    function CreateSetPolyfill() {\n      return (\n        /** @class */\n        function () {\n          function Set() {\n            this._map = new _Map();\n          }\n\n          Object.defineProperty(Set.prototype, \"size\", {\n            get: function () {\n              return this._map.size;\n            },\n            enumerable: true,\n            configurable: true\n          });\n\n          Set.prototype.has = function (value) {\n            return this._map.has(value);\n          };\n\n          Set.prototype.add = function (value) {\n            return this._map.set(value, value), this;\n          };\n\n          Set.prototype.delete = function (value) {\n            return this._map.delete(value);\n          };\n\n          Set.prototype.clear = function () {\n            this._map.clear();\n          };\n\n          Set.prototype.keys = function () {\n            return this._map.keys();\n          };\n\n          Set.prototype.values = function () {\n            return this._map.values();\n          };\n\n          Set.prototype.entries = function () {\n            return this._map.entries();\n          };\n\n          Set.prototype[\"@@iterator\"] = function () {\n            return this.keys();\n          };\n\n          Set.prototype[iteratorSymbol] = function () {\n            return this.keys();\n          };\n\n          return Set;\n        }()\n      );\n    } // naive WeakMap shim\n\n\n    function CreateWeakMapPolyfill() {\n      var UUID_SIZE = 16;\n      var keys = HashMap.create();\n      var rootKey = CreateUniqueKey();\n      return (\n        /** @class */\n        function () {\n          function WeakMap() {\n            this._key = CreateUniqueKey();\n          }\n\n          WeakMap.prototype.has = function (target) {\n            var table = GetOrCreateWeakMapTable(target,\n            /*create*/\n            false);\n            return table !== undefined ? HashMap.has(table, this._key) : false;\n          };\n\n          WeakMap.prototype.get = function (target) {\n            var table = GetOrCreateWeakMapTable(target,\n            /*create*/\n            false);\n            return table !== undefined ? HashMap.get(table, this._key) : undefined;\n          };\n\n          WeakMap.prototype.set = function (target, value) {\n            var table = GetOrCreateWeakMapTable(target,\n            /*create*/\n            true);\n            table[this._key] = value;\n            return this;\n          };\n\n          WeakMap.prototype.delete = function (target) {\n            var table = GetOrCreateWeakMapTable(target,\n            /*create*/\n            false);\n            return table !== undefined ? delete table[this._key] : false;\n          };\n\n          WeakMap.prototype.clear = function () {\n            // NOTE: not a real clear, just makes the previous data unreachable\n            this._key = CreateUniqueKey();\n          };\n\n          return WeakMap;\n        }()\n      );\n\n      function CreateUniqueKey() {\n        var key;\n\n        do key = \"@@WeakMap@@\" + CreateUUID(); while (HashMap.has(keys, key));\n\n        keys[key] = true;\n        return key;\n      }\n\n      function GetOrCreateWeakMapTable(target, create) {\n        if (!hasOwn.call(target, rootKey)) {\n          if (!create) return undefined;\n          Object.defineProperty(target, rootKey, {\n            value: HashMap.create()\n          });\n        }\n\n        return target[rootKey];\n      }\n\n      function FillRandomBytes(buffer, size) {\n        for (var i = 0; i < size; ++i) buffer[i] = Math.random() * 0xff | 0;\n\n        return buffer;\n      }\n\n      function GenRandomBytes(size) {\n        if (typeof Uint8Array === \"function\") {\n          if (typeof crypto !== \"undefined\") return crypto.getRandomValues(new Uint8Array(size));\n          if (typeof msCrypto !== \"undefined\") return msCrypto.getRandomValues(new Uint8Array(size));\n          return FillRandomBytes(new Uint8Array(size), size);\n        }\n\n        return FillRandomBytes(new Array(size), size);\n      }\n\n      function CreateUUID() {\n        var data = GenRandomBytes(UUID_SIZE); // mark as random - RFC 4122 § 4.4\n\n        data[6] = data[6] & 0x4f | 0x40;\n        data[8] = data[8] & 0xbf | 0x80;\n        var result = \"\";\n\n        for (var offset = 0; offset < UUID_SIZE; ++offset) {\n          var byte = data[offset];\n          if (offset === 4 || offset === 6 || offset === 8) result += \"-\";\n          if (byte < 16) result += \"0\";\n          result += byte.toString(16).toLowerCase();\n        }\n\n        return result;\n      }\n    } // uses a heuristic used by v8 and chakra to force an object into dictionary mode.\n\n\n    function MakeDictionary(obj) {\n      obj.__ = undefined;\n      delete obj.__;\n      return obj;\n    }\n  });\n})(Reflect || (Reflect = {}));","map":null,"metadata":{},"sourceType":"script"}