System.register(["__unresolved_0", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7", "__unresolved_8", "__unresolved_9"], function (_export, _context) {
  "use strict";

  var _req, _req2, _req3, _req4, _req5, _req6, _req7, _req8, _req9, _loader, _cjsExports, __cjsMetaURL;

  _export("default", void 0);

  return {
    setters: [function (_unresolved_) {
      _req = _unresolved_.__cjsMetaURL;
    }, function (_unresolved_2) {
      _req2 = _unresolved_2.__cjsMetaURL;
    }, function (_unresolved_3) {
      _req3 = _unresolved_3.__cjsMetaURL;
    }, function (_unresolved_4) {
      _req4 = _unresolved_4.__cjsMetaURL;
    }, function (_unresolved_5) {
      _req5 = _unresolved_5.__cjsMetaURL;
    }, function (_unresolved_6) {
      _req6 = _unresolved_6.__cjsMetaURL;
    }, function (_unresolved_7) {
      _req7 = _unresolved_7.__cjsMetaURL;
    }, function (_unresolved_8) {
      _req8 = _unresolved_8.__cjsMetaURL;
    }, function (_unresolved_9) {
      _req9 = _unresolved_9.__cjsMetaURL;
    }, function (_unresolved_10) {
      _loader = _unresolved_10.default;
    }],
    execute: function () {
      _loader.define(_context.meta.url, function (exports, _require, module, __filename, __dirname) {
        let require = _loader.createRequireWithReqMap({
          "../internals/native-weak-map": _req,
          "../internals/global": _req2,
          "../internals/function-uncurry-this": _req3,
          "../internals/is-object": _req4,
          "../internals/create-non-enumerable-property": _req5,
          "../internals/has-own-property": _req6,
          "../internals/shared-store": _req7,
          "../internals/shared-key": _req8,
          "../internals/hidden-keys": _req9
        }, _require);

        (function () {
          var NATIVE_WEAK_MAP = require('../internals/native-weak-map');

          var global = require('../internals/global');

          var uncurryThis = require('../internals/function-uncurry-this');

          var isObject = require('../internals/is-object');

          var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');

          var hasOwn = require('../internals/has-own-property');

          var shared = require('../internals/shared-store');

          var sharedKey = require('../internals/shared-key');

          var hiddenKeys = require('../internals/hidden-keys');

          var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
          var TypeError = global.TypeError;
          var WeakMap = global.WeakMap;
          var set, get, has;

          var enforce = function (it) {
            return has(it) ? get(it) : set(it, {});
          };

          var getterFor = function (TYPE) {
            return function (it) {
              var state;

              if (!isObject(it) || (state = get(it)).type !== TYPE) {
                throw TypeError('Incompatible receiver, ' + TYPE + ' required');
              }

              return state;
            };
          };

          if (NATIVE_WEAK_MAP || shared.state) {
            var store = shared.state || (shared.state = new WeakMap());
            var wmget = uncurryThis(store.get);
            var wmhas = uncurryThis(store.has);
            var wmset = uncurryThis(store.set);

            set = function (it, metadata) {
              if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
              metadata.facade = it;
              wmset(store, it, metadata);
              return metadata;
            };

            get = function (it) {
              return wmget(store, it) || {};
            };

            has = function (it) {
              return wmhas(store, it);
            };
          } else {
            var STATE = sharedKey('state');
            hiddenKeys[STATE] = true;

            set = function (it, metadata) {
              if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
              metadata.facade = it;
              createNonEnumerableProperty(it, STATE, metadata);
              return metadata;
            };

            get = function (it) {
              return hasOwn(it, STATE) ? it[STATE] : {};
            };

            has = function (it) {
              return hasOwn(it, STATE);
            };
          }

          module.exports = {
            set: set,
            get: get,
            has: has,
            enforce: enforce,
            getterFor: getterFor
          };
        })();

        _export("default", _cjsExports = module.exports);
      });

      _export("__cjsMetaURL", __cjsMetaURL = _context.meta.url);
    }
  };
});
//# sourceMappingURL=internal-state.js.map