diff --git a/bower.json b/bower.json index dcba48c..de24c55 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-polyfills", - "version": "1.1.1", + "version": "1.2.0", "description": "The minimal set of polyfills that the Aurelia platform needs to run on ES5 browsers.", "keywords": [ "aurelia", diff --git a/dist/amd/aurelia-polyfills.js b/dist/amd/aurelia-polyfills.js index 93abe93..5032dd1 100644 --- a/dist/amd/aurelia-polyfills.js +++ b/dist/amd/aurelia-polyfills.js @@ -7,266 +7,273 @@ define(['aurelia-pal'], function (_aureliaPal) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; - (function (Object, GOPS) { - 'use strict'; - - if (GOPS in Object) return; - - var setDescriptor, - G = _aureliaPal.PLATFORM.global, - id = 0, - random = '' + Math.random(), - prefix = '__\x01symbol:', - prefixLength = prefix.length, - internalSymbol = '__\x01symbol@@' + random, - DP = 'defineProperty', - DPies = 'defineProperties', - GOPN = 'getOwnPropertyNames', - GOPD = 'getOwnPropertyDescriptor', - PIE = 'propertyIsEnumerable', - gOPN = Object[GOPN], - gOPD = Object[GOPD], - create = Object.create, - keys = Object.keys, - defineProperty = Object[DP], - $defineProperties = Object[DPies], - descriptor = gOPD(Object, GOPN), - ObjectProto = Object.prototype, - hOP = ObjectProto.hasOwnProperty, - pIE = ObjectProto[PIE], - toString = ObjectProto.toString, - indexOf = Array.prototype.indexOf || function (v) { - for (var i = this.length; i-- && this[i] !== v;) {} - return i; - }, - addInternalIfNeeded = function addInternalIfNeeded(o, uid, enumerable) { - if (!hOP.call(o, internalSymbol)) { - defineProperty(o, internalSymbol, { - enumerable: false, - configurable: false, - writable: false, - value: {} - }); - } - o[internalSymbol]['@@' + uid] = enumerable; - }, - createWithSymbols = function createWithSymbols(proto, descriptors) { - var self = create(proto); - gOPN(descriptors).forEach(function (key) { - if (propertyIsEnumerable.call(descriptors, key)) { - $defineProperty(self, key, descriptors[key]); - } - }); - return self; - }, - copyAsNonEnumerable = function copyAsNonEnumerable(descriptor) { - var newDescriptor = create(descriptor); - newDescriptor.enumerable = false; - return newDescriptor; - }, - get = function get() {}, - onlyNonSymbols = function onlyNonSymbols(name) { - return name != internalSymbol && !hOP.call(source, name); - }, - onlySymbols = function onlySymbols(name) { - return name != internalSymbol && hOP.call(source, name); - }, - propertyIsEnumerable = function propertyIsEnumerable(key) { - var uid = '' + key; - return onlySymbols(uid) ? hOP.call(this, uid) && this[internalSymbol]['@@' + uid] : pIE.call(this, key); - }, - setAndGetSymbol = function setAndGetSymbol(uid) { - var descriptor = { - enumerable: false, - configurable: true, - get: get, - set: function set(value) { - setDescriptor(this, uid, { + if (typeof FEATURE_NO_ES2015 === 'undefined') { + + (function (Object, GOPS) { + 'use strict'; + + if (GOPS in Object) return; + + var setDescriptor, + G = _aureliaPal.PLATFORM.global, + id = 0, + random = '' + Math.random(), + prefix = '__\x01symbol:', + prefixLength = prefix.length, + internalSymbol = '__\x01symbol@@' + random, + DP = 'defineProperty', + DPies = 'defineProperties', + GOPN = 'getOwnPropertyNames', + GOPD = 'getOwnPropertyDescriptor', + PIE = 'propertyIsEnumerable', + gOPN = Object[GOPN], + gOPD = Object[GOPD], + create = Object.create, + keys = Object.keys, + defineProperty = Object[DP], + $defineProperties = Object[DPies], + descriptor = gOPD(Object, GOPN), + ObjectProto = Object.prototype, + hOP = ObjectProto.hasOwnProperty, + pIE = ObjectProto[PIE], + toString = ObjectProto.toString, + indexOf = Array.prototype.indexOf || function (v) { + for (var i = this.length; i-- && this[i] !== v;) {} + return i; + }, + addInternalIfNeeded = function addInternalIfNeeded(o, uid, enumerable) { + if (!hOP.call(o, internalSymbol)) { + defineProperty(o, internalSymbol, { enumerable: false, - configurable: true, - writable: true, - value: value + configurable: false, + writable: false, + value: {} }); - addInternalIfNeeded(this, uid, true); } - }; - defineProperty(ObjectProto, uid, descriptor); - return source[uid] = defineProperty(Object(uid), 'constructor', sourceConstructor); - }, - _Symbol = function _Symbol2(description) { - if (this && this !== G) { - throw new TypeError('Symbol is not a constructor'); - } - return setAndGetSymbol(prefix.concat(description || '', random, ++id)); - }, - source = create(null), - sourceConstructor = { value: _Symbol }, - sourceMap = function sourceMap(uid) { - return source[uid]; - }, - $defineProperty = function defineProp(o, key, descriptor) { - var uid = '' + key; - if (onlySymbols(uid)) { - setDescriptor(o, uid, descriptor.enumerable ? copyAsNonEnumerable(descriptor) : descriptor); - addInternalIfNeeded(o, uid, !!descriptor.enumerable); - } else { - defineProperty(o, key, descriptor); - } - return o; - }, - $getOwnPropertySymbols = function getOwnPropertySymbols(o) { - var cof = toString.call(o); - o = cof === '[object String]' ? o.split('') : Object(o); - return gOPN(o).filter(onlySymbols).map(sourceMap); - }; - - descriptor.value = $defineProperty; - defineProperty(Object, DP, descriptor); - - descriptor.value = $getOwnPropertySymbols; - defineProperty(Object, GOPS, descriptor); - - descriptor.value = function getOwnPropertyNames(o) { - return gOPN(o).filter(onlyNonSymbols); - }; - defineProperty(Object, GOPN, descriptor); - - descriptor.value = function defineProperties(o, descriptors) { - var symbols = $getOwnPropertySymbols(descriptors); - if (symbols.length) { - keys(descriptors).concat(symbols).forEach(function (uid) { - if (propertyIsEnumerable.call(descriptors, uid)) { - $defineProperty(o, uid, descriptors[uid]); + o[internalSymbol]['@@' + uid] = enumerable; + }, + createWithSymbols = function createWithSymbols(proto, descriptors) { + var self = create(proto); + gOPN(descriptors).forEach(function (key) { + if (propertyIsEnumerable.call(descriptors, key)) { + $defineProperty(self, key, descriptors[key]); } }); - } else { - $defineProperties(o, descriptors); - } - return o; - }; - defineProperty(Object, DPies, descriptor); + return self; + }, + copyAsNonEnumerable = function copyAsNonEnumerable(descriptor) { + var newDescriptor = create(descriptor); + newDescriptor.enumerable = false; + return newDescriptor; + }, + get = function get() {}, + onlyNonSymbols = function onlyNonSymbols(name) { + return name != internalSymbol && !hOP.call(source, name); + }, + onlySymbols = function onlySymbols(name) { + return name != internalSymbol && hOP.call(source, name); + }, + propertyIsEnumerable = function propertyIsEnumerable(key) { + var uid = '' + key; + return onlySymbols(uid) ? hOP.call(this, uid) && this[internalSymbol]['@@' + uid] : pIE.call(this, key); + }, + setAndGetSymbol = function setAndGetSymbol(uid) { + var descriptor = { + enumerable: false, + configurable: true, + get: get, + set: function set(value) { + setDescriptor(this, uid, { + enumerable: false, + configurable: true, + writable: true, + value: value + }); + addInternalIfNeeded(this, uid, true); + } + }; + defineProperty(ObjectProto, uid, descriptor); + return source[uid] = defineProperty(Object(uid), 'constructor', sourceConstructor); + }, + _Symbol = function _Symbol2(description) { + if (this && this !== G) { + throw new TypeError('Symbol is not a constructor'); + } + return setAndGetSymbol(prefix.concat(description || '', random, ++id)); + }, + source = create(null), + sourceConstructor = { value: _Symbol }, + sourceMap = function sourceMap(uid) { + return source[uid]; + }, + $defineProperty = function defineProp(o, key, descriptor) { + var uid = '' + key; + if (onlySymbols(uid)) { + setDescriptor(o, uid, descriptor.enumerable ? copyAsNonEnumerable(descriptor) : descriptor); + addInternalIfNeeded(o, uid, !!descriptor.enumerable); + } else { + defineProperty(o, key, descriptor); + } + return o; + }, + $getOwnPropertySymbols = function getOwnPropertySymbols(o) { + var cof = toString.call(o); + o = cof === '[object String]' ? o.split('') : Object(o); + return gOPN(o).filter(onlySymbols).map(sourceMap); + }; - descriptor.value = propertyIsEnumerable; - defineProperty(ObjectProto, PIE, descriptor); + descriptor.value = $defineProperty; + defineProperty(Object, DP, descriptor); - descriptor.value = _Symbol; - defineProperty(G, 'Symbol', descriptor); + descriptor.value = $getOwnPropertySymbols; + defineProperty(Object, GOPS, descriptor); - descriptor.value = function (key) { - var uid = prefix.concat(prefix, key, random); - return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid); - }; - defineProperty(_Symbol, 'for', descriptor); + descriptor.value = function getOwnPropertyNames(o) { + return gOPN(o).filter(onlyNonSymbols); + }; + defineProperty(Object, GOPN, descriptor); + + descriptor.value = function defineProperties(o, descriptors) { + var symbols = $getOwnPropertySymbols(descriptors); + if (symbols.length) { + keys(descriptors).concat(symbols).forEach(function (uid) { + if (propertyIsEnumerable.call(descriptors, uid)) { + $defineProperty(o, uid, descriptors[uid]); + } + }); + } else { + $defineProperties(o, descriptors); + } + return o; + }; + defineProperty(Object, DPies, descriptor); - descriptor.value = function (symbol) { - return hOP.call(source, symbol) ? symbol.slice(prefixLength * 2, -random.length) : void 0; - }; - defineProperty(_Symbol, 'keyFor', descriptor); + descriptor.value = propertyIsEnumerable; + defineProperty(ObjectProto, PIE, descriptor); - descriptor.value = function getOwnPropertyDescriptor(o, key) { - var descriptor = gOPD(o, key); - if (descriptor && onlySymbols(key)) { - descriptor.enumerable = propertyIsEnumerable.call(o, key); - } - return descriptor; - }; - defineProperty(Object, GOPD, descriptor); + descriptor.value = _Symbol; + defineProperty(G, 'Symbol', descriptor); - descriptor.value = function (proto, descriptors) { - return arguments.length === 1 ? create(proto) : createWithSymbols(proto, descriptors); - }; - defineProperty(Object, 'create', descriptor); + descriptor.value = function (key) { + var uid = prefix.concat(prefix, key, random); + return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid); + }; + defineProperty(_Symbol, 'for', descriptor); - descriptor.value = function () { - var str = toString.call(this); - return str === '[object String]' && onlySymbols(this) ? '[object Symbol]' : str; - }; - defineProperty(ObjectProto, 'toString', descriptor); + descriptor.value = function (symbol) { + return hOP.call(source, symbol) ? symbol.slice(prefixLength * 2, -random.length) : void 0; + }; + defineProperty(_Symbol, 'keyFor', descriptor); - try { - setDescriptor = create(defineProperty({}, prefix, { - get: function get() { - return defineProperty(this, prefix, { value: false })[prefix]; + descriptor.value = function getOwnPropertyDescriptor(o, key) { + var descriptor = gOPD(o, key); + if (descriptor && onlySymbols(key)) { + descriptor.enumerable = propertyIsEnumerable.call(o, key); } - }))[prefix] || defineProperty; - } catch (o_O) { - setDescriptor = function setDescriptor(o, key, descriptor) { - var protoDescriptor = gOPD(ObjectProto, key); - delete ObjectProto[key]; - defineProperty(o, key, descriptor); - defineProperty(ObjectProto, key, protoDescriptor); + return descriptor; }; - } - })(Object, 'getOwnPropertySymbols'); - - (function (O, S) { - var dP = O.defineProperty, - ObjectProto = O.prototype, - toString = ObjectProto.toString, - toStringTag = 'toStringTag', - descriptor; - ['iterator', 'match', 'replace', 'search', 'split', 'hasInstance', 'isConcatSpreadable', 'unscopables', 'species', 'toPrimitive', toStringTag].forEach(function (name) { - if (!(name in Symbol)) { - dP(Symbol, name, { value: Symbol(name) }); - switch (name) { - case toStringTag: - descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); - descriptor.value = function () { - var str = toString.call(this), - tst = typeof this === 'undefined' || this === null ? undefined : this[Symbol.toStringTag]; - return typeof tst === 'undefined' ? str : '[object ' + tst + ']'; - }; - dP(ObjectProto, 'toString', descriptor); - break; - } - } - }); - })(Object, Symbol); + defineProperty(Object, GOPD, descriptor); - (function (Si, AP, SP) { + descriptor.value = function (proto, descriptors) { + return arguments.length === 1 ? create(proto) : createWithSymbols(proto, descriptors); + }; + defineProperty(Object, 'create', descriptor); - function returnThis() { - return this; - } + descriptor.value = function () { + var str = toString.call(this); + return str === '[object String]' && onlySymbols(this) ? '[object Symbol]' : str; + }; + defineProperty(ObjectProto, 'toString', descriptor); - if (!AP[Si]) AP[Si] = function () { - var i = 0, - self = this, - iterator = { - next: function next() { - var done = self.length <= i; - return done ? { done: done } : { done: done, value: self[i++] }; + try { + setDescriptor = create(defineProperty({}, prefix, { + get: function get() { + return defineProperty(this, prefix, { value: false })[prefix]; + } + }))[prefix] || defineProperty; + } catch (o_O) { + setDescriptor = function setDescriptor(o, key, descriptor) { + var protoDescriptor = gOPD(ObjectProto, key); + delete ObjectProto[key]; + defineProperty(o, key, descriptor); + defineProperty(ObjectProto, key, protoDescriptor); + }; + } + })(Object, 'getOwnPropertySymbols'); + + (function (O, S) { + var dP = O.defineProperty, + ObjectProto = O.prototype, + toString = ObjectProto.toString, + toStringTag = 'toStringTag', + descriptor; + ['iterator', 'match', 'replace', 'search', 'split', 'hasInstance', 'isConcatSpreadable', 'unscopables', 'species', 'toPrimitive', toStringTag].forEach(function (name) { + if (!(name in Symbol)) { + dP(Symbol, name, { value: Symbol(name) }); + switch (name) { + case toStringTag: + descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); + descriptor.value = function () { + var str = toString.call(this), + tst = typeof this === 'undefined' || this === null ? undefined : this[Symbol.toStringTag]; + return typeof tst === 'undefined' ? str : '[object ' + tst + ']'; + }; + dP(ObjectProto, 'toString', descriptor); + break; + } } + }); + })(Object, Symbol); + + (function (Si, AP, SP) { + + function returnThis() { + return this; + } + + if (!AP[Si]) AP[Si] = function () { + var i = 0, + self = this, + iterator = { + next: function next() { + var done = self.length <= i; + return done ? { done: done } : { done: done, value: self[i++] }; + } + }; + iterator[Si] = returnThis; + return iterator; }; - iterator[Si] = returnThis; - return iterator; - }; - if (!SP[Si]) SP[Si] = function () { - var fromCodePoint = String.fromCodePoint, - self = this, - i = 0, - length = self.length, - iterator = { - next: function next() { - var done = length <= i, - c = done ? '' : fromCodePoint(self.codePointAt(i)); - i += c.length; - return done ? { done: done } : { done: done, value: c }; - } + if (!SP[Si]) SP[Si] = function () { + var fromCodePoint = String.fromCodePoint, + self = this, + i = 0, + length = self.length, + iterator = { + next: function next() { + var done = length <= i, + c = done ? '' : fromCodePoint(self.codePointAt(i)); + i += c.length; + return done ? { done: done } : { done: done, value: c }; + } + }; + iterator[Si] = returnThis; + return iterator; }; - iterator[Si] = returnThis; - return iterator; + })(Symbol.iterator, Array.prototype, String.prototype); + } + + if (typeof FEATURE_NO_ES2015 === 'undefined') { + + Number.isNaN = Number.isNaN || function (value) { + return value !== value; }; - })(Symbol.iterator, Array.prototype, String.prototype); - Number.isNaN = Number.isNaN || function (value) { - return value !== value; - }; + Number.isFinite = Number.isFinite || function (value) { + return typeof value === "number" && isFinite(value); + }; + } - Number.isFinite = Number.isFinite || function (value) { - return typeof value === "number" && isFinite(value); - }; if (!String.prototype.endsWith || function () { try { return !"ab".endsWith("a", 1); @@ -298,109 +305,112 @@ define(['aurelia-pal'], function (_aureliaPal) { }; } - if (!Array.from) { - Array.from = function () { - var toInteger = function toInteger(it) { - return isNaN(it = +it) ? 0 : (it > 0 ? Math.floor : Math.ceil)(it); - }; - var toLength = function toLength(it) { - return it > 0 ? Math.min(toInteger(it), 0x1fffffffffffff) : 0; - }; - var iterCall = function iterCall(iter, fn, val, index) { - try { - return fn(val, index); - } catch (E) { - if (typeof iter.return == 'function') iter.return(); - throw E; - } - }; + if (typeof FEATURE_NO_ES2015 === 'undefined') { - return function from(arrayLike) { - var O = Object(arrayLike), - C = typeof this == 'function' ? this : Array, - aLen = arguments.length, - mapfn = aLen > 1 ? arguments[1] : undefined, - mapping = mapfn !== undefined, - index = 0, - iterFn = O[Symbol.iterator], - length, - result, - step, - iterator; - if (mapping) mapfn = mapfn.bind(aLen > 2 ? arguments[2] : undefined); - if (iterFn != undefined && !Array.isArray(arrayLike)) { - for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { - result[index] = mapping ? iterCall(iterator, mapfn, step.value, index) : step.value; + if (!Array.from) { + Array.from = function () { + var toInteger = function toInteger(it) { + return isNaN(it = +it) ? 0 : (it > 0 ? Math.floor : Math.ceil)(it); + }; + var toLength = function toLength(it) { + return it > 0 ? Math.min(toInteger(it), 0x1fffffffffffff) : 0; + }; + var iterCall = function iterCall(iter, fn, val, index) { + try { + return fn(val, index); + } catch (E) { + if (typeof iter.return == 'function') iter.return(); + throw E; } - } else { - length = toLength(O.length); - for (result = new C(length); length > index; index++) { - result[index] = mapping ? mapfn(O[index], index) : O[index]; + }; + + return function from(arrayLike) { + var O = Object(arrayLike), + C = typeof this == 'function' ? this : Array, + aLen = arguments.length, + mapfn = aLen > 1 ? arguments[1] : undefined, + mapping = mapfn !== undefined, + index = 0, + iterFn = O[Symbol.iterator], + length, + result, + step, + iterator; + if (mapping) mapfn = mapfn.bind(aLen > 2 ? arguments[2] : undefined); + if (iterFn != undefined && !Array.isArray(arrayLike)) { + for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { + result[index] = mapping ? iterCall(iterator, mapfn, step.value, index) : step.value; + } + } else { + length = toLength(O.length); + for (result = new C(length); length > index; index++) { + result[index] = mapping ? mapfn(O[index], index) : O[index]; + } } - } - result.length = index; - return result; - }; - }(); - } + result.length = index; + return result; + }; + }(); + } - if (!Array.prototype.find) { - Object.defineProperty(Array.prototype, 'find', { - configurable: true, - writable: true, - enumerable: false, - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.find called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return value; + if (!Array.prototype.find) { + Object.defineProperty(Array.prototype, 'find', { + configurable: true, + writable: true, + enumerable: false, + value: function value(predicate) { + if (this === null) { + throw new TypeError('Array.prototype.find called on null or undefined'); + } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return value; + } } + return undefined; } - return undefined; - } - }); - } + }); + } - if (!Array.prototype.findIndex) { - Object.defineProperty(Array.prototype, 'findIndex', { - configurable: true, - writable: true, - enumerable: false, - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.findIndex called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return i; + if (!Array.prototype.findIndex) { + Object.defineProperty(Array.prototype, 'findIndex', { + configurable: true, + writable: true, + enumerable: false, + value: function value(predicate) { + if (this === null) { + throw new TypeError('Array.prototype.findIndex called on null or undefined'); + } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return i; + } } + return -1; } - return -1; - } - }); + }); + } } - if (!Array.prototype.includes) { + if (typeof FEATURE_NO_ES2016 === 'undefined' && !Array.prototype.includes) { Object.defineProperty(Array.prototype, 'includes', { configurable: true, writable: true, @@ -434,376 +444,393 @@ define(['aurelia-pal'], function (_aureliaPal) { }); } - (function () { - var needsFix = false; + if (typeof FEATURE_NO_ES2015 === 'undefined') { - try { - var s = Object.keys('a'); - needsFix = s.length !== 1 || s[0] !== '0'; - } catch (e) { - needsFix = true; - } + (function () { + var needsFix = false; - if (needsFix) { - Object.keys = function () { - var hasOwnProperty = Object.prototype.hasOwnProperty, - hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'), - dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], - dontEnumsLength = dontEnums.length; + try { + var s = Object.keys('a'); + needsFix = s.length !== 1 || s[0] !== '0'; + } catch (e) { + needsFix = true; + } - return function (obj) { - if (obj === undefined || obj === null) { - throw TypeError('Cannot convert undefined or null to object'); - } + if (needsFix) { + Object.keys = function () { + var hasOwnProperty = Object.prototype.hasOwnProperty, + hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'), + dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], + dontEnumsLength = dontEnums.length; - obj = Object(obj); + return function (obj) { + if (obj === undefined || obj === null) { + throw TypeError('Cannot convert undefined or null to object'); + } + + obj = Object(obj); - var result = [], - prop, - i; + var result = [], + prop, + i; - for (prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - result.push(prop); + for (prop in obj) { + if (hasOwnProperty.call(obj, prop)) { + result.push(prop); + } } - } - if (hasDontEnumBug) { - for (i = 0; i < dontEnumsLength; i++) { - if (hasOwnProperty.call(obj, dontEnums[i])) { - result.push(dontEnums[i]); + if (hasDontEnumBug) { + for (i = 0; i < dontEnumsLength; i++) { + if (hasOwnProperty.call(obj, dontEnums[i])) { + result.push(dontEnums[i]); + } } } - } - return result; - }; - }(); - } - })(); + return result; + }; + }(); + } + })(); - (function (O) { - if ('assign' in O) { - return; - } + (function (O) { + if ('assign' in O) { + return; + } - O.defineProperty(O, 'assign', { - configurable: true, - writable: true, - value: function () { - var gOPS = O.getOwnPropertySymbols, - pIE = O.propertyIsEnumerable, - filterOS = gOPS ? function (self) { - return gOPS(self).filter(pIE, self); - } : function () { - return Array.prototype; - }; + O.defineProperty(O, 'assign', { + configurable: true, + writable: true, + value: function () { + var gOPS = O.getOwnPropertySymbols, + pIE = O.propertyIsEnumerable, + filterOS = gOPS ? function (self) { + return gOPS(self).filter(pIE, self); + } : function () { + return Array.prototype; + }; + + return function assign(where) { + if (gOPS && !(where instanceof O)) { + console.warn('problematic Symbols', where); + } - return function assign(where) { - if (gOPS && !(where instanceof O)) { - console.warn('problematic Symbols', where); - } + function set(keyOrSymbol) { + where[keyOrSymbol] = arg[keyOrSymbol]; + } - function set(keyOrSymbol) { - where[keyOrSymbol] = arg[keyOrSymbol]; - } + for (var i = 1, ii = arguments.length; i < ii; ++i) { + var arg = arguments[i]; - for (var i = 1, ii = arguments.length; i < ii; ++i) { - var arg = arguments[i]; + if (arg === null || arg === undefined) { + continue; + } - if (arg === null || arg === undefined) { - continue; + O.keys(arg).concat(filterOS(arg)).forEach(set); } - O.keys(arg).concat(filterOS(arg)).forEach(set); - } - - return where; - }; - }() - }); - })(Object); + return where; + }; + }() + }); + })(Object); + } - (function (global) { - var i; + if (typeof FEATURE_NO_ES2015 === 'undefined') { - var defineProperty = Object.defineProperty, - is = function is(a, b) { - return a === b || a !== a && b !== b; - }; + (function (global) { + var i; - if (typeof WeakMap == 'undefined') { - global.WeakMap = createCollection({ - 'delete': sharedDelete, + var defineProperty = Object.defineProperty, + is = function is(a, b) { + return a === b || a !== a && b !== b; + }; - clear: sharedClear, + if (typeof WeakMap == 'undefined') { + global.WeakMap = createCollection({ + 'delete': sharedDelete, - get: sharedGet, + clear: sharedClear, - has: mapHas, + get: sharedGet, - set: sharedSet - }, true); - } + has: mapHas, - if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) { - var _createCollection; - - global.Map = createCollection((_createCollection = { - 'delete': sharedDelete, + set: sharedSet + }, true); + } - has: mapHas, + if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) { + var _createCollection; - get: sharedGet, + global.Map = createCollection((_createCollection = { + 'delete': sharedDelete, - set: sharedSet, + has: mapHas, - keys: sharedKeys, + get: sharedGet, - values: sharedValues, + set: sharedSet, - entries: mapEntries, + keys: sharedKeys, - forEach: sharedForEach, + values: sharedValues, - clear: sharedClear - }, _createCollection[Symbol.iterator] = mapEntries, _createCollection)); - } + entries: mapEntries, - if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) { - var _createCollection2; + forEach: sharedForEach, - global.Set = createCollection((_createCollection2 = { - has: setHas, + clear: sharedClear + }, _createCollection[Symbol.iterator] = mapEntries, _createCollection)); + } - add: sharedAdd, + if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) { + var _createCollection2; - 'delete': sharedDelete, + global.Set = createCollection((_createCollection2 = { + has: setHas, - clear: sharedClear, + add: sharedAdd, - keys: sharedValues, - values: sharedValues, + 'delete': sharedDelete, - entries: setEntries, + clear: sharedClear, - forEach: sharedForEach - }, _createCollection2[Symbol.iterator] = sharedValues, _createCollection2)); - } + keys: sharedValues, + values: sharedValues, - if (typeof WeakSet == 'undefined') { - global.WeakSet = createCollection({ - 'delete': sharedDelete, + entries: setEntries, - add: sharedAdd, + forEach: sharedForEach + }, _createCollection2[Symbol.iterator] = sharedValues, _createCollection2)); + } - clear: sharedClear, + if (typeof WeakSet == 'undefined') { + global.WeakSet = createCollection({ + 'delete': sharedDelete, - has: setHas - }, true); - } + add: sharedAdd, - function createCollection(proto, objectOnly) { - function Collection(a) { - if (!this || this.constructor !== Collection) return new Collection(a); - this._keys = []; - this._values = []; - this._itp = []; - this.objectOnly = objectOnly; + clear: sharedClear, - if (a) init.call(this, a); + has: setHas + }, true); } - if (!objectOnly) { - defineProperty(proto, 'size', { - get: sharedSize - }); - } + function createCollection(proto, objectOnly) { + function Collection(a) { + if (!this || this.constructor !== Collection) return new Collection(a); + this._keys = []; + this._values = []; + this._itp = []; + this.objectOnly = objectOnly; - proto.constructor = Collection; - Collection.prototype = proto; + if (a) init.call(this, a); + } - return Collection; - } + if (!objectOnly) { + defineProperty(proto, 'size', { + get: sharedSize + }); + } - function init(a) { - var i; + proto.constructor = Collection; + Collection.prototype = proto; - if (this.add) a.forEach(this.add, this);else a.forEach(function (a) { - this.set(a[0], a[1]); - }, this); - } + return Collection; + } - function sharedDelete(key) { - if (this.has(key)) { - this._keys.splice(i, 1); - this._values.splice(i, 1); + function init(a) { + var i; - this._itp.forEach(function (p) { - if (i < p[0]) p[0]--; - }); + if (this.add) a.forEach(this.add, this);else a.forEach(function (a) { + this.set(a[0], a[1]); + }, this); } - return -1 < i; - }; - - function sharedGet(key) { - return this.has(key) ? this._values[i] : undefined; - } + function sharedDelete(key) { + if (this.has(key)) { + this._keys.splice(i, 1); + this._values.splice(i, 1); - function has(list, key) { - if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key"); + this._itp.forEach(function (p) { + if (i < p[0]) p[0]--; + }); + } - if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key); - return -1 < i; - } + return -1 < i; + }; - function setHas(value) { - return has.call(this, this._values, value); - } + function sharedGet(key) { + return this.has(key) ? this._values[i] : undefined; + } - function mapHas(value) { - return has.call(this, this._keys, value); - } + function has(list, key) { + if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key"); - function sharedSet(key, value) { - this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; - return this; - } + if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key); + return -1 < i; + } - function sharedAdd(value) { - if (!this.has(value)) this._values.push(value); - return this; - } + function setHas(value) { + return has.call(this, this._values, value); + } - function sharedClear() { - (this._keys || 0).length = this._values.length = 0; - } + function mapHas(value) { + return has.call(this, this._keys, value); + } - function sharedKeys() { - return sharedIterator(this._itp, this._keys); - } + function sharedSet(key, value) { + this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; + return this; + } - function sharedValues() { - return sharedIterator(this._itp, this._values); - } + function sharedAdd(value) { + if (!this.has(value)) this._values.push(value); + return this; + } - function mapEntries() { - return sharedIterator(this._itp, this._keys, this._values); - } + function sharedClear() { + (this._keys || 0).length = this._values.length = 0; + } - function setEntries() { - return sharedIterator(this._itp, this._values, this._values); - } + function sharedKeys() { + return sharedIterator(this._itp, this._keys); + } - function sharedIterator(itp, array, array2) { - var _ref; + function sharedValues() { + return sharedIterator(this._itp, this._values); + } - var p = [0], - done = false; - itp.push(p); - return _ref = {}, _ref[Symbol.iterator] = function () { - return this; - }, _ref.next = function next() { - var v, - k = p[0]; - if (!done && k < array.length) { - v = array2 ? [array[k], array2[k]] : array[k]; - p[0]++; - } else { - done = true; - itp.splice(itp.indexOf(p), 1); - } - return { done: done, value: v }; - }, _ref; - } + function mapEntries() { + return sharedIterator(this._itp, this._keys, this._values); + } - function sharedSize() { - return this._values.length; - } + function setEntries() { + return sharedIterator(this._itp, this._values, this._values); + } - function sharedForEach(callback, context) { - var it = this.entries(); - for (;;) { - var r = it.next(); - if (r.done) break; - callback.call(context, r.value[1], r.value[0], this); + function sharedIterator(itp, array, array2) { + var _ref; + + var p = [0], + done = false; + itp.push(p); + return _ref = {}, _ref[Symbol.iterator] = function () { + return this; + }, _ref.next = function next() { + var v, + k = p[0]; + if (!done && k < array.length) { + v = array2 ? [array[k], array2[k]] : array[k]; + p[0]++; + } else { + done = true; + itp.splice(itp.indexOf(p), 1); + } + return { done: done, value: v }; + }, _ref; } - } - })(_aureliaPal.PLATFORM.global); - var emptyMetadata = Object.freeze({}); - var metadataContainerKey = '__metadata__'; - var bind = Function.prototype.bind; + function sharedSize() { + return this._values.length; + } - if (typeof _aureliaPal.PLATFORM.global.Reflect === 'undefined') { - _aureliaPal.PLATFORM.global.Reflect = {}; + function sharedForEach(callback, context) { + var it = this.entries(); + for (;;) { + var r = it.next(); + if (r.done) break; + callback.call(context, r.value[1], r.value[0], this); + } + } + })(_aureliaPal.PLATFORM.global); } - if (typeof Reflect.getOwnMetadata !== 'function') { - Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { - if (target.hasOwnProperty(metadataContainerKey)) { - return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; + if (typeof FEATURE_NO_ES2015 === 'undefined') { + (function () { + + var bind = Function.prototype.bind; + + if (typeof _aureliaPal.PLATFORM.global.Reflect === 'undefined') { + _aureliaPal.PLATFORM.global.Reflect = {}; } - }; - } - if (typeof Reflect.defineMetadata !== 'function') { - Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) { - var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {}; - var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); - targetContainer[metadataKey] = metadataValue; - }; - } + if (typeof Reflect.defineProperty !== 'function') { + Reflect.defineProperty = function (target, propertyKey, descriptor) { + if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' ? target === null : typeof target !== 'function') { + throw new TypeError('Reflect.defineProperty called on non-object'); + } + try { + Object.defineProperty(target, propertyKey, descriptor); + return true; + } catch (e) { + return false; + } + }; + } - if (typeof Reflect.metadata !== 'function') { - Reflect.metadata = function (metadataKey, metadataValue) { - return function (target, targetKey) { - Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); - }; - }; - } + if (typeof Reflect.construct !== 'function') { + Reflect.construct = function (Target, args) { + if (args) { + switch (args.length) { + case 0: + return new Target(); + case 1: + return new Target(args[0]); + case 2: + return new Target(args[0], args[1]); + case 3: + return new Target(args[0], args[1], args[2]); + case 4: + return new Target(args[0], args[1], args[2], args[3]); + } + } - if (typeof Reflect.defineProperty !== 'function') { - Reflect.defineProperty = function (target, propertyKey, descriptor) { - if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' ? target === null : typeof target !== 'function') { - throw new TypeError('Reflect.defineProperty called on non-object'); + var a = [null]; + a.push.apply(a, args); + return new (bind.apply(Target, a))(); + }; } - try { - Object.defineProperty(target, propertyKey, descriptor); - return true; - } catch (e) { - return false; + + if (typeof Reflect.ownKeys !== 'function') { + Reflect.ownKeys = function (o) { + return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o)); + }; } - }; + })(); } - if (typeof Reflect.construct !== 'function') { - Reflect.construct = function (Target, args) { - if (args) { - switch (args.length) { - case 0: - return new Target(); - case 1: - return new Target(args[0]); - case 2: - return new Target(args[0], args[1]); - case 3: - return new Target(args[0], args[1], args[2]); - case 4: - return new Target(args[0], args[1], args[2], args[3]); - } + if (typeof FEATURE_NO_ESNEXT === 'undefined') { + (function () { + + var emptyMetadata = Object.freeze({}); + var metadataContainerKey = '__metadata__'; + + if (typeof Reflect.getOwnMetadata !== 'function') { + Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { + if (target.hasOwnProperty(metadataContainerKey)) { + return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; + } + }; } - var a = [null]; - a.push.apply(a, args); - return new (bind.apply(Target, a))(); - }; - } + if (typeof Reflect.defineMetadata !== 'function') { + Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) { + var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {}; + var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); + targetContainer[metadataKey] = metadataValue; + }; + } - if (typeof Reflect.ownKeys !== 'function') { - Reflect.ownKeys = function (o) { - return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o)); - }; + if (typeof Reflect.metadata !== 'function') { + Reflect.metadata = function (metadataKey, metadataValue) { + return function (target, targetKey) { + Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); + }; + }; + } + })(); } }); \ No newline at end of file diff --git a/dist/aurelia-polyfills.js b/dist/aurelia-polyfills.js index 84a1d18..36ce1a6 100644 --- a/dist/aurelia-polyfills.js +++ b/dist/aurelia-polyfills.js @@ -1,5 +1,7 @@ import {PLATFORM} from 'aurelia-pal'; +if (typeof FEATURE_NO_ES2015 === 'undefined') { + (function (Object, GOPS) {'use strict'; // (C) Andrea Giammarchi - Mit Style @@ -311,6 +313,11 @@ import {PLATFORM} from 'aurelia-pal'; }(Symbol.iterator, Array.prototype, String.prototype)); + +} // endif FEATURE_NO_ES2015 + +if (typeof FEATURE_NO_ES2015 === 'undefined') { + Number.isNaN = Number.isNaN || function(value) { return value !== value; }; @@ -318,6 +325,9 @@ Number.isNaN = Number.isNaN || function(value) { Number.isFinite = Number.isFinite || function(value) { return typeof value === "number" && isFinite(value); }; + +} // endif FEATURE_NO_ES2015 + if ((!String.prototype.endsWith) || ((function() { try { return !("ab".endsWith("a",1)); } catch (e) { return true; } } )())) { String.prototype.endsWith = function(searchString, position) { let subjectString = this.toString(); @@ -337,6 +347,8 @@ if ((!String.prototype.startsWith) || ((function() { try { return !("ab".startsW }; } +if (typeof FEATURE_NO_ES2015 === 'undefined') { + if (!Array.from) { Array.from = (function () { var toInteger = function(it) { @@ -438,7 +450,9 @@ if (!Array.prototype.findIndex) { }); } -if (!Array.prototype.includes) { +} // endif FEATURE_NO_ES2015 + +if (typeof FEATURE_NO_ES2016 === 'undefined' && !Array.prototype.includes) { Object.defineProperty(Array.prototype, 'includes', { configurable: true, writable: true, @@ -471,6 +485,8 @@ if (!Array.prototype.includes) { }); } +if (typeof FEATURE_NO_ES2015 === 'undefined') { + (function() { let needsFix = false; @@ -577,6 +593,10 @@ if (!Array.prototype.includes) { }); }(Object)); +} // endif FEATURE_NO_ES2015 + +if (typeof FEATURE_NO_ES2015 === 'undefined') { + (function (global) { //shared pointer var i; @@ -811,38 +831,16 @@ if (!Array.prototype.includes) { })(PLATFORM.global); -const emptyMetadata = Object.freeze({}); -const metadataContainerKey = '__metadata__'; +} // endif (FEATURE_NO_ES2015) + +if (typeof FEATURE_NO_ES2015 === 'undefined') { + const bind = Function.prototype.bind; if (typeof PLATFORM.global.Reflect === 'undefined') { PLATFORM.global.Reflect = {}; } -if (typeof Reflect.getOwnMetadata !== 'function') { - Reflect.getOwnMetadata = function(metadataKey, target, targetKey) { - if (target.hasOwnProperty(metadataContainerKey)) { - return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; - } - }; -} - -if (typeof Reflect.defineMetadata !== 'function') { - Reflect.defineMetadata = function(metadataKey, metadataValue, target, targetKey) { - let metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : (target[metadataContainerKey] = {}); - let targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); - targetContainer[metadataKey] = metadataValue; - }; -} - -if (typeof Reflect.metadata !== 'function') { - Reflect.metadata = function(metadataKey, metadataValue) { - return function(target, targetKey) { - Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); - }; - }; -} - if (typeof Reflect.defineProperty !== 'function') { Reflect.defineProperty = function(target, propertyKey, descriptor) { if (typeof target === 'object' ? target === null : typeof target !== 'function') { @@ -878,3 +876,36 @@ if (typeof Reflect.construct !== 'function') { if (typeof Reflect.ownKeys !== 'function') { Reflect.ownKeys = function(o) { return (Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o))); } } + +} // endif FEATURE_NO_ES2015 + +if (typeof FEATURE_NO_ESNEXT === 'undefined') { + +const emptyMetadata = Object.freeze({}); +const metadataContainerKey = '__metadata__'; + +if (typeof Reflect.getOwnMetadata !== 'function') { + Reflect.getOwnMetadata = function(metadataKey, target, targetKey) { + if (target.hasOwnProperty(metadataContainerKey)) { + return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; + } + }; +} + +if (typeof Reflect.defineMetadata !== 'function') { + Reflect.defineMetadata = function(metadataKey, metadataValue, target, targetKey) { + let metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : (target[metadataContainerKey] = {}); + let targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); + targetContainer[metadataKey] = metadataValue; + }; +} + +if (typeof Reflect.metadata !== 'function') { + Reflect.metadata = function(metadataKey, metadataValue) { + return function(target, targetKey) { + Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); + }; + }; +} + +} // endif FEATURE_NO_ESNEXT diff --git a/dist/commonjs/aurelia-polyfills.js b/dist/commonjs/aurelia-polyfills.js index c9a6acc..456f840 100644 --- a/dist/commonjs/aurelia-polyfills.js +++ b/dist/commonjs/aurelia-polyfills.js @@ -4,266 +4,273 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol var _aureliaPal = require('aurelia-pal'); -(function (Object, GOPS) { - 'use strict'; - - if (GOPS in Object) return; - - var setDescriptor, - G = _aureliaPal.PLATFORM.global, - id = 0, - random = '' + Math.random(), - prefix = '__\x01symbol:', - prefixLength = prefix.length, - internalSymbol = '__\x01symbol@@' + random, - DP = 'defineProperty', - DPies = 'defineProperties', - GOPN = 'getOwnPropertyNames', - GOPD = 'getOwnPropertyDescriptor', - PIE = 'propertyIsEnumerable', - gOPN = Object[GOPN], - gOPD = Object[GOPD], - create = Object.create, - keys = Object.keys, - defineProperty = Object[DP], - $defineProperties = Object[DPies], - descriptor = gOPD(Object, GOPN), - ObjectProto = Object.prototype, - hOP = ObjectProto.hasOwnProperty, - pIE = ObjectProto[PIE], - toString = ObjectProto.toString, - indexOf = Array.prototype.indexOf || function (v) { - for (var i = this.length; i-- && this[i] !== v;) {} - return i; - }, - addInternalIfNeeded = function addInternalIfNeeded(o, uid, enumerable) { - if (!hOP.call(o, internalSymbol)) { - defineProperty(o, internalSymbol, { - enumerable: false, - configurable: false, - writable: false, - value: {} - }); - } - o[internalSymbol]['@@' + uid] = enumerable; - }, - createWithSymbols = function createWithSymbols(proto, descriptors) { - var self = create(proto); - gOPN(descriptors).forEach(function (key) { - if (propertyIsEnumerable.call(descriptors, key)) { - $defineProperty(self, key, descriptors[key]); - } - }); - return self; - }, - copyAsNonEnumerable = function copyAsNonEnumerable(descriptor) { - var newDescriptor = create(descriptor); - newDescriptor.enumerable = false; - return newDescriptor; - }, - get = function get() {}, - onlyNonSymbols = function onlyNonSymbols(name) { - return name != internalSymbol && !hOP.call(source, name); - }, - onlySymbols = function onlySymbols(name) { - return name != internalSymbol && hOP.call(source, name); - }, - propertyIsEnumerable = function propertyIsEnumerable(key) { - var uid = '' + key; - return onlySymbols(uid) ? hOP.call(this, uid) && this[internalSymbol]['@@' + uid] : pIE.call(this, key); - }, - setAndGetSymbol = function setAndGetSymbol(uid) { - var descriptor = { - enumerable: false, - configurable: true, - get: get, - set: function set(value) { - setDescriptor(this, uid, { +if (typeof FEATURE_NO_ES2015 === 'undefined') { + + (function (Object, GOPS) { + 'use strict'; + + if (GOPS in Object) return; + + var setDescriptor, + G = _aureliaPal.PLATFORM.global, + id = 0, + random = '' + Math.random(), + prefix = '__\x01symbol:', + prefixLength = prefix.length, + internalSymbol = '__\x01symbol@@' + random, + DP = 'defineProperty', + DPies = 'defineProperties', + GOPN = 'getOwnPropertyNames', + GOPD = 'getOwnPropertyDescriptor', + PIE = 'propertyIsEnumerable', + gOPN = Object[GOPN], + gOPD = Object[GOPD], + create = Object.create, + keys = Object.keys, + defineProperty = Object[DP], + $defineProperties = Object[DPies], + descriptor = gOPD(Object, GOPN), + ObjectProto = Object.prototype, + hOP = ObjectProto.hasOwnProperty, + pIE = ObjectProto[PIE], + toString = ObjectProto.toString, + indexOf = Array.prototype.indexOf || function (v) { + for (var i = this.length; i-- && this[i] !== v;) {} + return i; + }, + addInternalIfNeeded = function addInternalIfNeeded(o, uid, enumerable) { + if (!hOP.call(o, internalSymbol)) { + defineProperty(o, internalSymbol, { enumerable: false, - configurable: true, - writable: true, - value: value + configurable: false, + writable: false, + value: {} }); - addInternalIfNeeded(this, uid, true); } - }; - defineProperty(ObjectProto, uid, descriptor); - return source[uid] = defineProperty(Object(uid), 'constructor', sourceConstructor); - }, - _Symbol = function _Symbol2(description) { - if (this && this !== G) { - throw new TypeError('Symbol is not a constructor'); - } - return setAndGetSymbol(prefix.concat(description || '', random, ++id)); - }, - source = create(null), - sourceConstructor = { value: _Symbol }, - sourceMap = function sourceMap(uid) { - return source[uid]; - }, - $defineProperty = function defineProp(o, key, descriptor) { - var uid = '' + key; - if (onlySymbols(uid)) { - setDescriptor(o, uid, descriptor.enumerable ? copyAsNonEnumerable(descriptor) : descriptor); - addInternalIfNeeded(o, uid, !!descriptor.enumerable); - } else { - defineProperty(o, key, descriptor); - } - return o; - }, - $getOwnPropertySymbols = function getOwnPropertySymbols(o) { - var cof = toString.call(o); - o = cof === '[object String]' ? o.split('') : Object(o); - return gOPN(o).filter(onlySymbols).map(sourceMap); - }; - - descriptor.value = $defineProperty; - defineProperty(Object, DP, descriptor); - - descriptor.value = $getOwnPropertySymbols; - defineProperty(Object, GOPS, descriptor); - - descriptor.value = function getOwnPropertyNames(o) { - return gOPN(o).filter(onlyNonSymbols); - }; - defineProperty(Object, GOPN, descriptor); - - descriptor.value = function defineProperties(o, descriptors) { - var symbols = $getOwnPropertySymbols(descriptors); - if (symbols.length) { - keys(descriptors).concat(symbols).forEach(function (uid) { - if (propertyIsEnumerable.call(descriptors, uid)) { - $defineProperty(o, uid, descriptors[uid]); + o[internalSymbol]['@@' + uid] = enumerable; + }, + createWithSymbols = function createWithSymbols(proto, descriptors) { + var self = create(proto); + gOPN(descriptors).forEach(function (key) { + if (propertyIsEnumerable.call(descriptors, key)) { + $defineProperty(self, key, descriptors[key]); } }); - } else { - $defineProperties(o, descriptors); - } - return o; - }; - defineProperty(Object, DPies, descriptor); + return self; + }, + copyAsNonEnumerable = function copyAsNonEnumerable(descriptor) { + var newDescriptor = create(descriptor); + newDescriptor.enumerable = false; + return newDescriptor; + }, + get = function get() {}, + onlyNonSymbols = function onlyNonSymbols(name) { + return name != internalSymbol && !hOP.call(source, name); + }, + onlySymbols = function onlySymbols(name) { + return name != internalSymbol && hOP.call(source, name); + }, + propertyIsEnumerable = function propertyIsEnumerable(key) { + var uid = '' + key; + return onlySymbols(uid) ? hOP.call(this, uid) && this[internalSymbol]['@@' + uid] : pIE.call(this, key); + }, + setAndGetSymbol = function setAndGetSymbol(uid) { + var descriptor = { + enumerable: false, + configurable: true, + get: get, + set: function set(value) { + setDescriptor(this, uid, { + enumerable: false, + configurable: true, + writable: true, + value: value + }); + addInternalIfNeeded(this, uid, true); + } + }; + defineProperty(ObjectProto, uid, descriptor); + return source[uid] = defineProperty(Object(uid), 'constructor', sourceConstructor); + }, + _Symbol = function _Symbol2(description) { + if (this && this !== G) { + throw new TypeError('Symbol is not a constructor'); + } + return setAndGetSymbol(prefix.concat(description || '', random, ++id)); + }, + source = create(null), + sourceConstructor = { value: _Symbol }, + sourceMap = function sourceMap(uid) { + return source[uid]; + }, + $defineProperty = function defineProp(o, key, descriptor) { + var uid = '' + key; + if (onlySymbols(uid)) { + setDescriptor(o, uid, descriptor.enumerable ? copyAsNonEnumerable(descriptor) : descriptor); + addInternalIfNeeded(o, uid, !!descriptor.enumerable); + } else { + defineProperty(o, key, descriptor); + } + return o; + }, + $getOwnPropertySymbols = function getOwnPropertySymbols(o) { + var cof = toString.call(o); + o = cof === '[object String]' ? o.split('') : Object(o); + return gOPN(o).filter(onlySymbols).map(sourceMap); + }; - descriptor.value = propertyIsEnumerable; - defineProperty(ObjectProto, PIE, descriptor); + descriptor.value = $defineProperty; + defineProperty(Object, DP, descriptor); - descriptor.value = _Symbol; - defineProperty(G, 'Symbol', descriptor); + descriptor.value = $getOwnPropertySymbols; + defineProperty(Object, GOPS, descriptor); - descriptor.value = function (key) { - var uid = prefix.concat(prefix, key, random); - return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid); - }; - defineProperty(_Symbol, 'for', descriptor); + descriptor.value = function getOwnPropertyNames(o) { + return gOPN(o).filter(onlyNonSymbols); + }; + defineProperty(Object, GOPN, descriptor); + + descriptor.value = function defineProperties(o, descriptors) { + var symbols = $getOwnPropertySymbols(descriptors); + if (symbols.length) { + keys(descriptors).concat(symbols).forEach(function (uid) { + if (propertyIsEnumerable.call(descriptors, uid)) { + $defineProperty(o, uid, descriptors[uid]); + } + }); + } else { + $defineProperties(o, descriptors); + } + return o; + }; + defineProperty(Object, DPies, descriptor); - descriptor.value = function (symbol) { - return hOP.call(source, symbol) ? symbol.slice(prefixLength * 2, -random.length) : void 0; - }; - defineProperty(_Symbol, 'keyFor', descriptor); + descriptor.value = propertyIsEnumerable; + defineProperty(ObjectProto, PIE, descriptor); - descriptor.value = function getOwnPropertyDescriptor(o, key) { - var descriptor = gOPD(o, key); - if (descriptor && onlySymbols(key)) { - descriptor.enumerable = propertyIsEnumerable.call(o, key); - } - return descriptor; - }; - defineProperty(Object, GOPD, descriptor); + descriptor.value = _Symbol; + defineProperty(G, 'Symbol', descriptor); - descriptor.value = function (proto, descriptors) { - return arguments.length === 1 ? create(proto) : createWithSymbols(proto, descriptors); - }; - defineProperty(Object, 'create', descriptor); + descriptor.value = function (key) { + var uid = prefix.concat(prefix, key, random); + return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid); + }; + defineProperty(_Symbol, 'for', descriptor); - descriptor.value = function () { - var str = toString.call(this); - return str === '[object String]' && onlySymbols(this) ? '[object Symbol]' : str; - }; - defineProperty(ObjectProto, 'toString', descriptor); + descriptor.value = function (symbol) { + return hOP.call(source, symbol) ? symbol.slice(prefixLength * 2, -random.length) : void 0; + }; + defineProperty(_Symbol, 'keyFor', descriptor); - try { - setDescriptor = create(defineProperty({}, prefix, { - get: function get() { - return defineProperty(this, prefix, { value: false })[prefix]; + descriptor.value = function getOwnPropertyDescriptor(o, key) { + var descriptor = gOPD(o, key); + if (descriptor && onlySymbols(key)) { + descriptor.enumerable = propertyIsEnumerable.call(o, key); } - }))[prefix] || defineProperty; - } catch (o_O) { - setDescriptor = function setDescriptor(o, key, descriptor) { - var protoDescriptor = gOPD(ObjectProto, key); - delete ObjectProto[key]; - defineProperty(o, key, descriptor); - defineProperty(ObjectProto, key, protoDescriptor); + return descriptor; }; - } -})(Object, 'getOwnPropertySymbols'); - -(function (O, S) { - var dP = O.defineProperty, - ObjectProto = O.prototype, - toString = ObjectProto.toString, - toStringTag = 'toStringTag', - descriptor; - ['iterator', 'match', 'replace', 'search', 'split', 'hasInstance', 'isConcatSpreadable', 'unscopables', 'species', 'toPrimitive', toStringTag].forEach(function (name) { - if (!(name in Symbol)) { - dP(Symbol, name, { value: Symbol(name) }); - switch (name) { - case toStringTag: - descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); - descriptor.value = function () { - var str = toString.call(this), - tst = typeof this === 'undefined' || this === null ? undefined : this[Symbol.toStringTag]; - return typeof tst === 'undefined' ? str : '[object ' + tst + ']'; - }; - dP(ObjectProto, 'toString', descriptor); - break; - } - } - }); -})(Object, Symbol); + defineProperty(Object, GOPD, descriptor); -(function (Si, AP, SP) { + descriptor.value = function (proto, descriptors) { + return arguments.length === 1 ? create(proto) : createWithSymbols(proto, descriptors); + }; + defineProperty(Object, 'create', descriptor); - function returnThis() { - return this; - } + descriptor.value = function () { + var str = toString.call(this); + return str === '[object String]' && onlySymbols(this) ? '[object Symbol]' : str; + }; + defineProperty(ObjectProto, 'toString', descriptor); - if (!AP[Si]) AP[Si] = function () { - var i = 0, - self = this, - iterator = { - next: function next() { - var done = self.length <= i; - return done ? { done: done } : { done: done, value: self[i++] }; + try { + setDescriptor = create(defineProperty({}, prefix, { + get: function get() { + return defineProperty(this, prefix, { value: false })[prefix]; + } + }))[prefix] || defineProperty; + } catch (o_O) { + setDescriptor = function setDescriptor(o, key, descriptor) { + var protoDescriptor = gOPD(ObjectProto, key); + delete ObjectProto[key]; + defineProperty(o, key, descriptor); + defineProperty(ObjectProto, key, protoDescriptor); + }; + } + })(Object, 'getOwnPropertySymbols'); + + (function (O, S) { + var dP = O.defineProperty, + ObjectProto = O.prototype, + toString = ObjectProto.toString, + toStringTag = 'toStringTag', + descriptor; + ['iterator', 'match', 'replace', 'search', 'split', 'hasInstance', 'isConcatSpreadable', 'unscopables', 'species', 'toPrimitive', toStringTag].forEach(function (name) { + if (!(name in Symbol)) { + dP(Symbol, name, { value: Symbol(name) }); + switch (name) { + case toStringTag: + descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); + descriptor.value = function () { + var str = toString.call(this), + tst = typeof this === 'undefined' || this === null ? undefined : this[Symbol.toStringTag]; + return typeof tst === 'undefined' ? str : '[object ' + tst + ']'; + }; + dP(ObjectProto, 'toString', descriptor); + break; + } } + }); + })(Object, Symbol); + + (function (Si, AP, SP) { + + function returnThis() { + return this; + } + + if (!AP[Si]) AP[Si] = function () { + var i = 0, + self = this, + iterator = { + next: function next() { + var done = self.length <= i; + return done ? { done: done } : { done: done, value: self[i++] }; + } + }; + iterator[Si] = returnThis; + return iterator; }; - iterator[Si] = returnThis; - return iterator; - }; - if (!SP[Si]) SP[Si] = function () { - var fromCodePoint = String.fromCodePoint, - self = this, - i = 0, - length = self.length, - iterator = { - next: function next() { - var done = length <= i, - c = done ? '' : fromCodePoint(self.codePointAt(i)); - i += c.length; - return done ? { done: done } : { done: done, value: c }; - } + if (!SP[Si]) SP[Si] = function () { + var fromCodePoint = String.fromCodePoint, + self = this, + i = 0, + length = self.length, + iterator = { + next: function next() { + var done = length <= i, + c = done ? '' : fromCodePoint(self.codePointAt(i)); + i += c.length; + return done ? { done: done } : { done: done, value: c }; + } + }; + iterator[Si] = returnThis; + return iterator; }; - iterator[Si] = returnThis; - return iterator; + })(Symbol.iterator, Array.prototype, String.prototype); +} + +if (typeof FEATURE_NO_ES2015 === 'undefined') { + + Number.isNaN = Number.isNaN || function (value) { + return value !== value; }; -})(Symbol.iterator, Array.prototype, String.prototype); -Number.isNaN = Number.isNaN || function (value) { - return value !== value; -}; + Number.isFinite = Number.isFinite || function (value) { + return typeof value === "number" && isFinite(value); + }; +} -Number.isFinite = Number.isFinite || function (value) { - return typeof value === "number" && isFinite(value); -}; if (!String.prototype.endsWith || function () { try { return !"ab".endsWith("a", 1); @@ -295,109 +302,112 @@ if (!String.prototype.startsWith || function () { }; } -if (!Array.from) { - Array.from = function () { - var toInteger = function toInteger(it) { - return isNaN(it = +it) ? 0 : (it > 0 ? Math.floor : Math.ceil)(it); - }; - var toLength = function toLength(it) { - return it > 0 ? Math.min(toInteger(it), 0x1fffffffffffff) : 0; - }; - var iterCall = function iterCall(iter, fn, val, index) { - try { - return fn(val, index); - } catch (E) { - if (typeof iter.return == 'function') iter.return(); - throw E; - } - }; +if (typeof FEATURE_NO_ES2015 === 'undefined') { - return function from(arrayLike) { - var O = Object(arrayLike), - C = typeof this == 'function' ? this : Array, - aLen = arguments.length, - mapfn = aLen > 1 ? arguments[1] : undefined, - mapping = mapfn !== undefined, - index = 0, - iterFn = O[Symbol.iterator], - length, - result, - step, - iterator; - if (mapping) mapfn = mapfn.bind(aLen > 2 ? arguments[2] : undefined); - if (iterFn != undefined && !Array.isArray(arrayLike)) { - for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { - result[index] = mapping ? iterCall(iterator, mapfn, step.value, index) : step.value; + if (!Array.from) { + Array.from = function () { + var toInteger = function toInteger(it) { + return isNaN(it = +it) ? 0 : (it > 0 ? Math.floor : Math.ceil)(it); + }; + var toLength = function toLength(it) { + return it > 0 ? Math.min(toInteger(it), 0x1fffffffffffff) : 0; + }; + var iterCall = function iterCall(iter, fn, val, index) { + try { + return fn(val, index); + } catch (E) { + if (typeof iter.return == 'function') iter.return(); + throw E; } - } else { - length = toLength(O.length); - for (result = new C(length); length > index; index++) { - result[index] = mapping ? mapfn(O[index], index) : O[index]; + }; + + return function from(arrayLike) { + var O = Object(arrayLike), + C = typeof this == 'function' ? this : Array, + aLen = arguments.length, + mapfn = aLen > 1 ? arguments[1] : undefined, + mapping = mapfn !== undefined, + index = 0, + iterFn = O[Symbol.iterator], + length, + result, + step, + iterator; + if (mapping) mapfn = mapfn.bind(aLen > 2 ? arguments[2] : undefined); + if (iterFn != undefined && !Array.isArray(arrayLike)) { + for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { + result[index] = mapping ? iterCall(iterator, mapfn, step.value, index) : step.value; + } + } else { + length = toLength(O.length); + for (result = new C(length); length > index; index++) { + result[index] = mapping ? mapfn(O[index], index) : O[index]; + } } - } - result.length = index; - return result; - }; - }(); -} + result.length = index; + return result; + }; + }(); + } -if (!Array.prototype.find) { - Object.defineProperty(Array.prototype, 'find', { - configurable: true, - writable: true, - enumerable: false, - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.find called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return value; + if (!Array.prototype.find) { + Object.defineProperty(Array.prototype, 'find', { + configurable: true, + writable: true, + enumerable: false, + value: function value(predicate) { + if (this === null) { + throw new TypeError('Array.prototype.find called on null or undefined'); } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return value; + } + } + return undefined; } - return undefined; - } - }); -} + }); + } -if (!Array.prototype.findIndex) { - Object.defineProperty(Array.prototype, 'findIndex', { - configurable: true, - writable: true, - enumerable: false, - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.findIndex called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return i; + if (!Array.prototype.findIndex) { + Object.defineProperty(Array.prototype, 'findIndex', { + configurable: true, + writable: true, + enumerable: false, + value: function value(predicate) { + if (this === null) { + throw new TypeError('Array.prototype.findIndex called on null or undefined'); } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return i; + } + } + return -1; } - return -1; - } - }); + }); + } } -if (!Array.prototype.includes) { +if (typeof FEATURE_NO_ES2016 === 'undefined' && !Array.prototype.includes) { Object.defineProperty(Array.prototype, 'includes', { configurable: true, writable: true, @@ -431,375 +441,392 @@ if (!Array.prototype.includes) { }); } -(function () { - var needsFix = false; +if (typeof FEATURE_NO_ES2015 === 'undefined') { - try { - var s = Object.keys('a'); - needsFix = s.length !== 1 || s[0] !== '0'; - } catch (e) { - needsFix = true; - } + (function () { + var needsFix = false; - if (needsFix) { - Object.keys = function () { - var hasOwnProperty = Object.prototype.hasOwnProperty, - hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'), - dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], - dontEnumsLength = dontEnums.length; + try { + var s = Object.keys('a'); + needsFix = s.length !== 1 || s[0] !== '0'; + } catch (e) { + needsFix = true; + } - return function (obj) { - if (obj === undefined || obj === null) { - throw TypeError('Cannot convert undefined or null to object'); - } + if (needsFix) { + Object.keys = function () { + var hasOwnProperty = Object.prototype.hasOwnProperty, + hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'), + dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], + dontEnumsLength = dontEnums.length; + + return function (obj) { + if (obj === undefined || obj === null) { + throw TypeError('Cannot convert undefined or null to object'); + } - obj = Object(obj); + obj = Object(obj); - var result = [], - prop, - i; + var result = [], + prop, + i; - for (prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - result.push(prop); + for (prop in obj) { + if (hasOwnProperty.call(obj, prop)) { + result.push(prop); + } } - } - if (hasDontEnumBug) { - for (i = 0; i < dontEnumsLength; i++) { - if (hasOwnProperty.call(obj, dontEnums[i])) { - result.push(dontEnums[i]); + if (hasDontEnumBug) { + for (i = 0; i < dontEnumsLength; i++) { + if (hasOwnProperty.call(obj, dontEnums[i])) { + result.push(dontEnums[i]); + } } } - } - return result; - }; - }(); - } -})(); + return result; + }; + }(); + } + })(); -(function (O) { - if ('assign' in O) { - return; - } + (function (O) { + if ('assign' in O) { + return; + } - O.defineProperty(O, 'assign', { - configurable: true, - writable: true, - value: function () { - var gOPS = O.getOwnPropertySymbols, - pIE = O.propertyIsEnumerable, - filterOS = gOPS ? function (self) { - return gOPS(self).filter(pIE, self); - } : function () { - return Array.prototype; - }; + O.defineProperty(O, 'assign', { + configurable: true, + writable: true, + value: function () { + var gOPS = O.getOwnPropertySymbols, + pIE = O.propertyIsEnumerable, + filterOS = gOPS ? function (self) { + return gOPS(self).filter(pIE, self); + } : function () { + return Array.prototype; + }; + + return function assign(where) { + if (gOPS && !(where instanceof O)) { + console.warn('problematic Symbols', where); + } - return function assign(where) { - if (gOPS && !(where instanceof O)) { - console.warn('problematic Symbols', where); - } + function set(keyOrSymbol) { + where[keyOrSymbol] = arg[keyOrSymbol]; + } - function set(keyOrSymbol) { - where[keyOrSymbol] = arg[keyOrSymbol]; - } + for (var i = 1, ii = arguments.length; i < ii; ++i) { + var arg = arguments[i]; - for (var i = 1, ii = arguments.length; i < ii; ++i) { - var arg = arguments[i]; + if (arg === null || arg === undefined) { + continue; + } - if (arg === null || arg === undefined) { - continue; + O.keys(arg).concat(filterOS(arg)).forEach(set); } - O.keys(arg).concat(filterOS(arg)).forEach(set); - } - - return where; - }; - }() - }); -})(Object); - -(function (global) { - var i; + return where; + }; + }() + }); + })(Object); +} - var defineProperty = Object.defineProperty, - is = function is(a, b) { - return a === b || a !== a && b !== b; - }; +if (typeof FEATURE_NO_ES2015 === 'undefined') { - if (typeof WeakMap == 'undefined') { - global.WeakMap = createCollection({ - 'delete': sharedDelete, + (function (global) { + var i; - clear: sharedClear, + var defineProperty = Object.defineProperty, + is = function is(a, b) { + return a === b || a !== a && b !== b; + }; - get: sharedGet, + if (typeof WeakMap == 'undefined') { + global.WeakMap = createCollection({ + 'delete': sharedDelete, - has: mapHas, + clear: sharedClear, - set: sharedSet - }, true); - } + get: sharedGet, - if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) { - var _createCollection; + has: mapHas, - global.Map = createCollection((_createCollection = { - 'delete': sharedDelete, + set: sharedSet + }, true); + } - has: mapHas, + if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) { + var _createCollection; - get: sharedGet, + global.Map = createCollection((_createCollection = { + 'delete': sharedDelete, - set: sharedSet, + has: mapHas, - keys: sharedKeys, + get: sharedGet, - values: sharedValues, + set: sharedSet, - entries: mapEntries, + keys: sharedKeys, - forEach: sharedForEach, + values: sharedValues, - clear: sharedClear - }, _createCollection[Symbol.iterator] = mapEntries, _createCollection)); - } + entries: mapEntries, - if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) { - var _createCollection2; + forEach: sharedForEach, - global.Set = createCollection((_createCollection2 = { - has: setHas, + clear: sharedClear + }, _createCollection[Symbol.iterator] = mapEntries, _createCollection)); + } - add: sharedAdd, + if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) { + var _createCollection2; - 'delete': sharedDelete, + global.Set = createCollection((_createCollection2 = { + has: setHas, - clear: sharedClear, + add: sharedAdd, - keys: sharedValues, - values: sharedValues, + 'delete': sharedDelete, - entries: setEntries, + clear: sharedClear, - forEach: sharedForEach - }, _createCollection2[Symbol.iterator] = sharedValues, _createCollection2)); - } + keys: sharedValues, + values: sharedValues, - if (typeof WeakSet == 'undefined') { - global.WeakSet = createCollection({ - 'delete': sharedDelete, + entries: setEntries, - add: sharedAdd, + forEach: sharedForEach + }, _createCollection2[Symbol.iterator] = sharedValues, _createCollection2)); + } - clear: sharedClear, + if (typeof WeakSet == 'undefined') { + global.WeakSet = createCollection({ + 'delete': sharedDelete, - has: setHas - }, true); - } + add: sharedAdd, - function createCollection(proto, objectOnly) { - function Collection(a) { - if (!this || this.constructor !== Collection) return new Collection(a); - this._keys = []; - this._values = []; - this._itp = []; - this.objectOnly = objectOnly; + clear: sharedClear, - if (a) init.call(this, a); + has: setHas + }, true); } - if (!objectOnly) { - defineProperty(proto, 'size', { - get: sharedSize - }); - } + function createCollection(proto, objectOnly) { + function Collection(a) { + if (!this || this.constructor !== Collection) return new Collection(a); + this._keys = []; + this._values = []; + this._itp = []; + this.objectOnly = objectOnly; - proto.constructor = Collection; - Collection.prototype = proto; + if (a) init.call(this, a); + } - return Collection; - } + if (!objectOnly) { + defineProperty(proto, 'size', { + get: sharedSize + }); + } - function init(a) { - var i; + proto.constructor = Collection; + Collection.prototype = proto; - if (this.add) a.forEach(this.add, this);else a.forEach(function (a) { - this.set(a[0], a[1]); - }, this); - } + return Collection; + } - function sharedDelete(key) { - if (this.has(key)) { - this._keys.splice(i, 1); - this._values.splice(i, 1); + function init(a) { + var i; - this._itp.forEach(function (p) { - if (i < p[0]) p[0]--; - }); + if (this.add) a.forEach(this.add, this);else a.forEach(function (a) { + this.set(a[0], a[1]); + }, this); } - return -1 < i; - }; - - function sharedGet(key) { - return this.has(key) ? this._values[i] : undefined; - } + function sharedDelete(key) { + if (this.has(key)) { + this._keys.splice(i, 1); + this._values.splice(i, 1); - function has(list, key) { - if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key"); + this._itp.forEach(function (p) { + if (i < p[0]) p[0]--; + }); + } - if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key); - return -1 < i; - } + return -1 < i; + }; - function setHas(value) { - return has.call(this, this._values, value); - } + function sharedGet(key) { + return this.has(key) ? this._values[i] : undefined; + } - function mapHas(value) { - return has.call(this, this._keys, value); - } + function has(list, key) { + if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key"); - function sharedSet(key, value) { - this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; - return this; - } + if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key); + return -1 < i; + } - function sharedAdd(value) { - if (!this.has(value)) this._values.push(value); - return this; - } + function setHas(value) { + return has.call(this, this._values, value); + } - function sharedClear() { - (this._keys || 0).length = this._values.length = 0; - } + function mapHas(value) { + return has.call(this, this._keys, value); + } - function sharedKeys() { - return sharedIterator(this._itp, this._keys); - } + function sharedSet(key, value) { + this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; + return this; + } - function sharedValues() { - return sharedIterator(this._itp, this._values); - } + function sharedAdd(value) { + if (!this.has(value)) this._values.push(value); + return this; + } - function mapEntries() { - return sharedIterator(this._itp, this._keys, this._values); - } + function sharedClear() { + (this._keys || 0).length = this._values.length = 0; + } - function setEntries() { - return sharedIterator(this._itp, this._values, this._values); - } + function sharedKeys() { + return sharedIterator(this._itp, this._keys); + } - function sharedIterator(itp, array, array2) { - var _ref; + function sharedValues() { + return sharedIterator(this._itp, this._values); + } - var p = [0], - done = false; - itp.push(p); - return _ref = {}, _ref[Symbol.iterator] = function () { - return this; - }, _ref.next = function next() { - var v, - k = p[0]; - if (!done && k < array.length) { - v = array2 ? [array[k], array2[k]] : array[k]; - p[0]++; - } else { - done = true; - itp.splice(itp.indexOf(p), 1); - } - return { done: done, value: v }; - }, _ref; - } + function mapEntries() { + return sharedIterator(this._itp, this._keys, this._values); + } - function sharedSize() { - return this._values.length; - } + function setEntries() { + return sharedIterator(this._itp, this._values, this._values); + } - function sharedForEach(callback, context) { - var it = this.entries(); - for (;;) { - var r = it.next(); - if (r.done) break; - callback.call(context, r.value[1], r.value[0], this); + function sharedIterator(itp, array, array2) { + var _ref; + + var p = [0], + done = false; + itp.push(p); + return _ref = {}, _ref[Symbol.iterator] = function () { + return this; + }, _ref.next = function next() { + var v, + k = p[0]; + if (!done && k < array.length) { + v = array2 ? [array[k], array2[k]] : array[k]; + p[0]++; + } else { + done = true; + itp.splice(itp.indexOf(p), 1); + } + return { done: done, value: v }; + }, _ref; } - } -})(_aureliaPal.PLATFORM.global); -var emptyMetadata = Object.freeze({}); -var metadataContainerKey = '__metadata__'; -var bind = Function.prototype.bind; + function sharedSize() { + return this._values.length; + } -if (typeof _aureliaPal.PLATFORM.global.Reflect === 'undefined') { - _aureliaPal.PLATFORM.global.Reflect = {}; + function sharedForEach(callback, context) { + var it = this.entries(); + for (;;) { + var r = it.next(); + if (r.done) break; + callback.call(context, r.value[1], r.value[0], this); + } + } + })(_aureliaPal.PLATFORM.global); } -if (typeof Reflect.getOwnMetadata !== 'function') { - Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { - if (target.hasOwnProperty(metadataContainerKey)) { - return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; +if (typeof FEATURE_NO_ES2015 === 'undefined') { + (function () { + + var bind = Function.prototype.bind; + + if (typeof _aureliaPal.PLATFORM.global.Reflect === 'undefined') { + _aureliaPal.PLATFORM.global.Reflect = {}; } - }; -} -if (typeof Reflect.defineMetadata !== 'function') { - Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) { - var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {}; - var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); - targetContainer[metadataKey] = metadataValue; - }; -} + if (typeof Reflect.defineProperty !== 'function') { + Reflect.defineProperty = function (target, propertyKey, descriptor) { + if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' ? target === null : typeof target !== 'function') { + throw new TypeError('Reflect.defineProperty called on non-object'); + } + try { + Object.defineProperty(target, propertyKey, descriptor); + return true; + } catch (e) { + return false; + } + }; + } -if (typeof Reflect.metadata !== 'function') { - Reflect.metadata = function (metadataKey, metadataValue) { - return function (target, targetKey) { - Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); - }; - }; -} + if (typeof Reflect.construct !== 'function') { + Reflect.construct = function (Target, args) { + if (args) { + switch (args.length) { + case 0: + return new Target(); + case 1: + return new Target(args[0]); + case 2: + return new Target(args[0], args[1]); + case 3: + return new Target(args[0], args[1], args[2]); + case 4: + return new Target(args[0], args[1], args[2], args[3]); + } + } -if (typeof Reflect.defineProperty !== 'function') { - Reflect.defineProperty = function (target, propertyKey, descriptor) { - if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' ? target === null : typeof target !== 'function') { - throw new TypeError('Reflect.defineProperty called on non-object'); + var a = [null]; + a.push.apply(a, args); + return new (bind.apply(Target, a))(); + }; } - try { - Object.defineProperty(target, propertyKey, descriptor); - return true; - } catch (e) { - return false; + + if (typeof Reflect.ownKeys !== 'function') { + Reflect.ownKeys = function (o) { + return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o)); + }; } - }; + })(); } -if (typeof Reflect.construct !== 'function') { - Reflect.construct = function (Target, args) { - if (args) { - switch (args.length) { - case 0: - return new Target(); - case 1: - return new Target(args[0]); - case 2: - return new Target(args[0], args[1]); - case 3: - return new Target(args[0], args[1], args[2]); - case 4: - return new Target(args[0], args[1], args[2], args[3]); - } +if (typeof FEATURE_NO_ESNEXT === 'undefined') { + (function () { + + var emptyMetadata = Object.freeze({}); + var metadataContainerKey = '__metadata__'; + + if (typeof Reflect.getOwnMetadata !== 'function') { + Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { + if (target.hasOwnProperty(metadataContainerKey)) { + return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; + } + }; } - var a = [null]; - a.push.apply(a, args); - return new (bind.apply(Target, a))(); - }; -} + if (typeof Reflect.defineMetadata !== 'function') { + Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) { + var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {}; + var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); + targetContainer[metadataKey] = metadataValue; + }; + } -if (typeof Reflect.ownKeys !== 'function') { - Reflect.ownKeys = function (o) { - return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o)); - }; + if (typeof Reflect.metadata !== 'function') { + Reflect.metadata = function (metadataKey, metadataValue) { + return function (target, targetKey) { + Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); + }; + }; + } + })(); } \ No newline at end of file diff --git a/dist/es2015/aurelia-polyfills.js b/dist/es2015/aurelia-polyfills.js index 828bd44..d2d8e66 100644 --- a/dist/es2015/aurelia-polyfills.js +++ b/dist/es2015/aurelia-polyfills.js @@ -1,265 +1,272 @@ import { PLATFORM } from 'aurelia-pal'; -(function (Object, GOPS) { - 'use strict'; - - if (GOPS in Object) return; - - var setDescriptor, - G = PLATFORM.global, - id = 0, - random = '' + Math.random(), - prefix = '__\x01symbol:', - prefixLength = prefix.length, - internalSymbol = '__\x01symbol@@' + random, - DP = 'defineProperty', - DPies = 'defineProperties', - GOPN = 'getOwnPropertyNames', - GOPD = 'getOwnPropertyDescriptor', - PIE = 'propertyIsEnumerable', - gOPN = Object[GOPN], - gOPD = Object[GOPD], - create = Object.create, - keys = Object.keys, - defineProperty = Object[DP], - $defineProperties = Object[DPies], - descriptor = gOPD(Object, GOPN), - ObjectProto = Object.prototype, - hOP = ObjectProto.hasOwnProperty, - pIE = ObjectProto[PIE], - toString = ObjectProto.toString, - indexOf = Array.prototype.indexOf || function (v) { - for (var i = this.length; i-- && this[i] !== v;) {} - return i; - }, - addInternalIfNeeded = function (o, uid, enumerable) { - if (!hOP.call(o, internalSymbol)) { - defineProperty(o, internalSymbol, { - enumerable: false, - configurable: false, - writable: false, - value: {} - }); - } - o[internalSymbol]['@@' + uid] = enumerable; - }, - createWithSymbols = function (proto, descriptors) { - var self = create(proto); - gOPN(descriptors).forEach(function (key) { - if (propertyIsEnumerable.call(descriptors, key)) { - $defineProperty(self, key, descriptors[key]); - } - }); - return self; - }, - copyAsNonEnumerable = function (descriptor) { - var newDescriptor = create(descriptor); - newDescriptor.enumerable = false; - return newDescriptor; - }, - get = function get() {}, - onlyNonSymbols = function (name) { - return name != internalSymbol && !hOP.call(source, name); - }, - onlySymbols = function (name) { - return name != internalSymbol && hOP.call(source, name); - }, - propertyIsEnumerable = function propertyIsEnumerable(key) { - var uid = '' + key; - return onlySymbols(uid) ? hOP.call(this, uid) && this[internalSymbol]['@@' + uid] : pIE.call(this, key); - }, - setAndGetSymbol = function (uid) { - var descriptor = { - enumerable: false, - configurable: true, - get: get, - set: function (value) { - setDescriptor(this, uid, { +if (typeof FEATURE_NO_ES2015 === 'undefined') { + + (function (Object, GOPS) { + 'use strict'; + + if (GOPS in Object) return; + + var setDescriptor, + G = PLATFORM.global, + id = 0, + random = '' + Math.random(), + prefix = '__\x01symbol:', + prefixLength = prefix.length, + internalSymbol = '__\x01symbol@@' + random, + DP = 'defineProperty', + DPies = 'defineProperties', + GOPN = 'getOwnPropertyNames', + GOPD = 'getOwnPropertyDescriptor', + PIE = 'propertyIsEnumerable', + gOPN = Object[GOPN], + gOPD = Object[GOPD], + create = Object.create, + keys = Object.keys, + defineProperty = Object[DP], + $defineProperties = Object[DPies], + descriptor = gOPD(Object, GOPN), + ObjectProto = Object.prototype, + hOP = ObjectProto.hasOwnProperty, + pIE = ObjectProto[PIE], + toString = ObjectProto.toString, + indexOf = Array.prototype.indexOf || function (v) { + for (var i = this.length; i-- && this[i] !== v;) {} + return i; + }, + addInternalIfNeeded = function (o, uid, enumerable) { + if (!hOP.call(o, internalSymbol)) { + defineProperty(o, internalSymbol, { enumerable: false, - configurable: true, - writable: true, - value: value + configurable: false, + writable: false, + value: {} }); - addInternalIfNeeded(this, uid, true); } - }; - defineProperty(ObjectProto, uid, descriptor); - return source[uid] = defineProperty(Object(uid), 'constructor', sourceConstructor); - }, - Symbol = function Symbol(description) { - if (this && this !== G) { - throw new TypeError('Symbol is not a constructor'); - } - return setAndGetSymbol(prefix.concat(description || '', random, ++id)); - }, - source = create(null), - sourceConstructor = { value: Symbol }, - sourceMap = function (uid) { - return source[uid]; - }, - $defineProperty = function defineProp(o, key, descriptor) { - var uid = '' + key; - if (onlySymbols(uid)) { - setDescriptor(o, uid, descriptor.enumerable ? copyAsNonEnumerable(descriptor) : descriptor); - addInternalIfNeeded(o, uid, !!descriptor.enumerable); - } else { - defineProperty(o, key, descriptor); - } - return o; - }, - $getOwnPropertySymbols = function getOwnPropertySymbols(o) { - var cof = toString.call(o); - o = cof === '[object String]' ? o.split('') : Object(o); - return gOPN(o).filter(onlySymbols).map(sourceMap); - }; - - descriptor.value = $defineProperty; - defineProperty(Object, DP, descriptor); - - descriptor.value = $getOwnPropertySymbols; - defineProperty(Object, GOPS, descriptor); - - descriptor.value = function getOwnPropertyNames(o) { - return gOPN(o).filter(onlyNonSymbols); - }; - defineProperty(Object, GOPN, descriptor); - - descriptor.value = function defineProperties(o, descriptors) { - var symbols = $getOwnPropertySymbols(descriptors); - if (symbols.length) { - keys(descriptors).concat(symbols).forEach(function (uid) { - if (propertyIsEnumerable.call(descriptors, uid)) { - $defineProperty(o, uid, descriptors[uid]); + o[internalSymbol]['@@' + uid] = enumerable; + }, + createWithSymbols = function (proto, descriptors) { + var self = create(proto); + gOPN(descriptors).forEach(function (key) { + if (propertyIsEnumerable.call(descriptors, key)) { + $defineProperty(self, key, descriptors[key]); } }); - } else { - $defineProperties(o, descriptors); - } - return o; - }; - defineProperty(Object, DPies, descriptor); + return self; + }, + copyAsNonEnumerable = function (descriptor) { + var newDescriptor = create(descriptor); + newDescriptor.enumerable = false; + return newDescriptor; + }, + get = function get() {}, + onlyNonSymbols = function (name) { + return name != internalSymbol && !hOP.call(source, name); + }, + onlySymbols = function (name) { + return name != internalSymbol && hOP.call(source, name); + }, + propertyIsEnumerable = function propertyIsEnumerable(key) { + var uid = '' + key; + return onlySymbols(uid) ? hOP.call(this, uid) && this[internalSymbol]['@@' + uid] : pIE.call(this, key); + }, + setAndGetSymbol = function (uid) { + var descriptor = { + enumerable: false, + configurable: true, + get: get, + set: function (value) { + setDescriptor(this, uid, { + enumerable: false, + configurable: true, + writable: true, + value: value + }); + addInternalIfNeeded(this, uid, true); + } + }; + defineProperty(ObjectProto, uid, descriptor); + return source[uid] = defineProperty(Object(uid), 'constructor', sourceConstructor); + }, + Symbol = function Symbol(description) { + if (this && this !== G) { + throw new TypeError('Symbol is not a constructor'); + } + return setAndGetSymbol(prefix.concat(description || '', random, ++id)); + }, + source = create(null), + sourceConstructor = { value: Symbol }, + sourceMap = function (uid) { + return source[uid]; + }, + $defineProperty = function defineProp(o, key, descriptor) { + var uid = '' + key; + if (onlySymbols(uid)) { + setDescriptor(o, uid, descriptor.enumerable ? copyAsNonEnumerable(descriptor) : descriptor); + addInternalIfNeeded(o, uid, !!descriptor.enumerable); + } else { + defineProperty(o, key, descriptor); + } + return o; + }, + $getOwnPropertySymbols = function getOwnPropertySymbols(o) { + var cof = toString.call(o); + o = cof === '[object String]' ? o.split('') : Object(o); + return gOPN(o).filter(onlySymbols).map(sourceMap); + }; - descriptor.value = propertyIsEnumerable; - defineProperty(ObjectProto, PIE, descriptor); + descriptor.value = $defineProperty; + defineProperty(Object, DP, descriptor); - descriptor.value = Symbol; - defineProperty(G, 'Symbol', descriptor); + descriptor.value = $getOwnPropertySymbols; + defineProperty(Object, GOPS, descriptor); - descriptor.value = function (key) { - var uid = prefix.concat(prefix, key, random); - return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid); - }; - defineProperty(Symbol, 'for', descriptor); + descriptor.value = function getOwnPropertyNames(o) { + return gOPN(o).filter(onlyNonSymbols); + }; + defineProperty(Object, GOPN, descriptor); + + descriptor.value = function defineProperties(o, descriptors) { + var symbols = $getOwnPropertySymbols(descriptors); + if (symbols.length) { + keys(descriptors).concat(symbols).forEach(function (uid) { + if (propertyIsEnumerable.call(descriptors, uid)) { + $defineProperty(o, uid, descriptors[uid]); + } + }); + } else { + $defineProperties(o, descriptors); + } + return o; + }; + defineProperty(Object, DPies, descriptor); - descriptor.value = function (symbol) { - return hOP.call(source, symbol) ? symbol.slice(prefixLength * 2, -random.length) : void 0; - }; - defineProperty(Symbol, 'keyFor', descriptor); + descriptor.value = propertyIsEnumerable; + defineProperty(ObjectProto, PIE, descriptor); - descriptor.value = function getOwnPropertyDescriptor(o, key) { - var descriptor = gOPD(o, key); - if (descriptor && onlySymbols(key)) { - descriptor.enumerable = propertyIsEnumerable.call(o, key); - } - return descriptor; - }; - defineProperty(Object, GOPD, descriptor); + descriptor.value = Symbol; + defineProperty(G, 'Symbol', descriptor); - descriptor.value = function (proto, descriptors) { - return arguments.length === 1 ? create(proto) : createWithSymbols(proto, descriptors); - }; - defineProperty(Object, 'create', descriptor); + descriptor.value = function (key) { + var uid = prefix.concat(prefix, key, random); + return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid); + }; + defineProperty(Symbol, 'for', descriptor); - descriptor.value = function () { - var str = toString.call(this); - return str === '[object String]' && onlySymbols(this) ? '[object Symbol]' : str; - }; - defineProperty(ObjectProto, 'toString', descriptor); + descriptor.value = function (symbol) { + return hOP.call(source, symbol) ? symbol.slice(prefixLength * 2, -random.length) : void 0; + }; + defineProperty(Symbol, 'keyFor', descriptor); - try { - setDescriptor = create(defineProperty({}, prefix, { - get: function () { - return defineProperty(this, prefix, { value: false })[prefix]; + descriptor.value = function getOwnPropertyDescriptor(o, key) { + var descriptor = gOPD(o, key); + if (descriptor && onlySymbols(key)) { + descriptor.enumerable = propertyIsEnumerable.call(o, key); } - }))[prefix] || defineProperty; - } catch (o_O) { - setDescriptor = function (o, key, descriptor) { - var protoDescriptor = gOPD(ObjectProto, key); - delete ObjectProto[key]; - defineProperty(o, key, descriptor); - defineProperty(ObjectProto, key, protoDescriptor); + return descriptor; }; - } -})(Object, 'getOwnPropertySymbols'); - -(function (O, S) { - var dP = O.defineProperty, - ObjectProto = O.prototype, - toString = ObjectProto.toString, - toStringTag = 'toStringTag', - descriptor; - ['iterator', 'match', 'replace', 'search', 'split', 'hasInstance', 'isConcatSpreadable', 'unscopables', 'species', 'toPrimitive', toStringTag].forEach(function (name) { - if (!(name in Symbol)) { - dP(Symbol, name, { value: Symbol(name) }); - switch (name) { - case toStringTag: - descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); - descriptor.value = function () { - var str = toString.call(this), - tst = typeof this === 'undefined' || this === null ? undefined : this[Symbol.toStringTag]; - return typeof tst === 'undefined' ? str : '[object ' + tst + ']'; - }; - dP(ObjectProto, 'toString', descriptor); - break; - } - } - }); -})(Object, Symbol); + defineProperty(Object, GOPD, descriptor); -(function (Si, AP, SP) { + descriptor.value = function (proto, descriptors) { + return arguments.length === 1 ? create(proto) : createWithSymbols(proto, descriptors); + }; + defineProperty(Object, 'create', descriptor); - function returnThis() { - return this; - } + descriptor.value = function () { + var str = toString.call(this); + return str === '[object String]' && onlySymbols(this) ? '[object Symbol]' : str; + }; + defineProperty(ObjectProto, 'toString', descriptor); - if (!AP[Si]) AP[Si] = function () { - var i = 0, - self = this, - iterator = { - next: function next() { - var done = self.length <= i; - return done ? { done: done } : { done: done, value: self[i++] }; + try { + setDescriptor = create(defineProperty({}, prefix, { + get: function () { + return defineProperty(this, prefix, { value: false })[prefix]; + } + }))[prefix] || defineProperty; + } catch (o_O) { + setDescriptor = function (o, key, descriptor) { + var protoDescriptor = gOPD(ObjectProto, key); + delete ObjectProto[key]; + defineProperty(o, key, descriptor); + defineProperty(ObjectProto, key, protoDescriptor); + }; + } + })(Object, 'getOwnPropertySymbols'); + + (function (O, S) { + var dP = O.defineProperty, + ObjectProto = O.prototype, + toString = ObjectProto.toString, + toStringTag = 'toStringTag', + descriptor; + ['iterator', 'match', 'replace', 'search', 'split', 'hasInstance', 'isConcatSpreadable', 'unscopables', 'species', 'toPrimitive', toStringTag].forEach(function (name) { + if (!(name in Symbol)) { + dP(Symbol, name, { value: Symbol(name) }); + switch (name) { + case toStringTag: + descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); + descriptor.value = function () { + var str = toString.call(this), + tst = typeof this === 'undefined' || this === null ? undefined : this[Symbol.toStringTag]; + return typeof tst === 'undefined' ? str : '[object ' + tst + ']'; + }; + dP(ObjectProto, 'toString', descriptor); + break; + } } + }); + })(Object, Symbol); + + (function (Si, AP, SP) { + + function returnThis() { + return this; + } + + if (!AP[Si]) AP[Si] = function () { + var i = 0, + self = this, + iterator = { + next: function next() { + var done = self.length <= i; + return done ? { done: done } : { done: done, value: self[i++] }; + } + }; + iterator[Si] = returnThis; + return iterator; }; - iterator[Si] = returnThis; - return iterator; - }; - if (!SP[Si]) SP[Si] = function () { - var fromCodePoint = String.fromCodePoint, - self = this, - i = 0, - length = self.length, - iterator = { - next: function next() { - var done = length <= i, - c = done ? '' : fromCodePoint(self.codePointAt(i)); - i += c.length; - return done ? { done: done } : { done: done, value: c }; - } + if (!SP[Si]) SP[Si] = function () { + var fromCodePoint = String.fromCodePoint, + self = this, + i = 0, + length = self.length, + iterator = { + next: function next() { + var done = length <= i, + c = done ? '' : fromCodePoint(self.codePointAt(i)); + i += c.length; + return done ? { done: done } : { done: done, value: c }; + } + }; + iterator[Si] = returnThis; + return iterator; }; - iterator[Si] = returnThis; - return iterator; + })(Symbol.iterator, Array.prototype, String.prototype); +} + +if (typeof FEATURE_NO_ES2015 === 'undefined') { + + Number.isNaN = Number.isNaN || function (value) { + return value !== value; }; -})(Symbol.iterator, Array.prototype, String.prototype); -Number.isNaN = Number.isNaN || function (value) { - return value !== value; -}; + Number.isFinite = Number.isFinite || function (value) { + return typeof value === "number" && isFinite(value); + }; +} -Number.isFinite = Number.isFinite || function (value) { - return typeof value === "number" && isFinite(value); -}; if (!String.prototype.endsWith || function () { try { return !"ab".endsWith("a", 1); @@ -291,109 +298,112 @@ if (!String.prototype.startsWith || function () { }; } -if (!Array.from) { - Array.from = function () { - var toInteger = function (it) { - return isNaN(it = +it) ? 0 : (it > 0 ? Math.floor : Math.ceil)(it); - }; - var toLength = function (it) { - return it > 0 ? Math.min(toInteger(it), 0x1fffffffffffff) : 0; - }; - var iterCall = function (iter, fn, val, index) { - try { - return fn(val, index); - } catch (E) { - if (typeof iter.return == 'function') iter.return(); - throw E; - } - }; +if (typeof FEATURE_NO_ES2015 === 'undefined') { - return function from(arrayLike) { - var O = Object(arrayLike), - C = typeof this == 'function' ? this : Array, - aLen = arguments.length, - mapfn = aLen > 1 ? arguments[1] : undefined, - mapping = mapfn !== undefined, - index = 0, - iterFn = O[Symbol.iterator], - length, - result, - step, - iterator; - if (mapping) mapfn = mapfn.bind(aLen > 2 ? arguments[2] : undefined); - if (iterFn != undefined && !Array.isArray(arrayLike)) { - for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { - result[index] = mapping ? iterCall(iterator, mapfn, step.value, index) : step.value; + if (!Array.from) { + Array.from = function () { + var toInteger = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? Math.floor : Math.ceil)(it); + }; + var toLength = function (it) { + return it > 0 ? Math.min(toInteger(it), 0x1fffffffffffff) : 0; + }; + var iterCall = function (iter, fn, val, index) { + try { + return fn(val, index); + } catch (E) { + if (typeof iter.return == 'function') iter.return(); + throw E; } - } else { - length = toLength(O.length); - for (result = new C(length); length > index; index++) { - result[index] = mapping ? mapfn(O[index], index) : O[index]; + }; + + return function from(arrayLike) { + var O = Object(arrayLike), + C = typeof this == 'function' ? this : Array, + aLen = arguments.length, + mapfn = aLen > 1 ? arguments[1] : undefined, + mapping = mapfn !== undefined, + index = 0, + iterFn = O[Symbol.iterator], + length, + result, + step, + iterator; + if (mapping) mapfn = mapfn.bind(aLen > 2 ? arguments[2] : undefined); + if (iterFn != undefined && !Array.isArray(arrayLike)) { + for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { + result[index] = mapping ? iterCall(iterator, mapfn, step.value, index) : step.value; + } + } else { + length = toLength(O.length); + for (result = new C(length); length > index; index++) { + result[index] = mapping ? mapfn(O[index], index) : O[index]; + } } - } - result.length = index; - return result; - }; - }(); -} + result.length = index; + return result; + }; + }(); + } -if (!Array.prototype.find) { - Object.defineProperty(Array.prototype, 'find', { - configurable: true, - writable: true, - enumerable: false, - value: function (predicate) { - if (this === null) { - throw new TypeError('Array.prototype.find called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return value; + if (!Array.prototype.find) { + Object.defineProperty(Array.prototype, 'find', { + configurable: true, + writable: true, + enumerable: false, + value: function (predicate) { + if (this === null) { + throw new TypeError('Array.prototype.find called on null or undefined'); + } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return value; + } + } + return undefined; } - return undefined; - } - }); -} + }); + } -if (!Array.prototype.findIndex) { - Object.defineProperty(Array.prototype, 'findIndex', { - configurable: true, - writable: true, - enumerable: false, - value: function (predicate) { - if (this === null) { - throw new TypeError('Array.prototype.findIndex called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return i; + if (!Array.prototype.findIndex) { + Object.defineProperty(Array.prototype, 'findIndex', { + configurable: true, + writable: true, + enumerable: false, + value: function (predicate) { + if (this === null) { + throw new TypeError('Array.prototype.findIndex called on null or undefined'); } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return i; + } + } + return -1; } - return -1; - } - }); + }); + } } -if (!Array.prototype.includes) { +if (typeof FEATURE_NO_ES2016 === 'undefined' && !Array.prototype.includes) { Object.defineProperty(Array.prototype, 'includes', { configurable: true, writable: true, @@ -427,376 +437,389 @@ if (!Array.prototype.includes) { }); } -(function () { - let needsFix = false; +if (typeof FEATURE_NO_ES2015 === 'undefined') { - try { - let s = Object.keys('a'); - needsFix = s.length !== 1 || s[0] !== '0'; - } catch (e) { - needsFix = true; - } + (function () { + let needsFix = false; - if (needsFix) { - Object.keys = function () { - var hasOwnProperty = Object.prototype.hasOwnProperty, - hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'), - dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], - dontEnumsLength = dontEnums.length; + try { + let s = Object.keys('a'); + needsFix = s.length !== 1 || s[0] !== '0'; + } catch (e) { + needsFix = true; + } - return function (obj) { - if (obj === undefined || obj === null) { - throw TypeError(`Cannot convert undefined or null to object`); - } + if (needsFix) { + Object.keys = function () { + var hasOwnProperty = Object.prototype.hasOwnProperty, + hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'), + dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], + dontEnumsLength = dontEnums.length; - obj = Object(obj); + return function (obj) { + if (obj === undefined || obj === null) { + throw TypeError(`Cannot convert undefined or null to object`); + } + + obj = Object(obj); - var result = [], - prop, - i; + var result = [], + prop, + i; - for (prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - result.push(prop); + for (prop in obj) { + if (hasOwnProperty.call(obj, prop)) { + result.push(prop); + } } - } - if (hasDontEnumBug) { - for (i = 0; i < dontEnumsLength; i++) { - if (hasOwnProperty.call(obj, dontEnums[i])) { - result.push(dontEnums[i]); + if (hasDontEnumBug) { + for (i = 0; i < dontEnumsLength; i++) { + if (hasOwnProperty.call(obj, dontEnums[i])) { + result.push(dontEnums[i]); + } } } - } - return result; - }; - }(); - } -})(); + return result; + }; + }(); + } + })(); -(function (O) { - if ('assign' in O) { - return; - } + (function (O) { + if ('assign' in O) { + return; + } - O.defineProperty(O, 'assign', { - configurable: true, - writable: true, - value: function () { - var gOPS = O.getOwnPropertySymbols, - pIE = O.propertyIsEnumerable, - filterOS = gOPS ? function (self) { - return gOPS(self).filter(pIE, self); - } : function () { - return Array.prototype; - }; + O.defineProperty(O, 'assign', { + configurable: true, + writable: true, + value: function () { + var gOPS = O.getOwnPropertySymbols, + pIE = O.propertyIsEnumerable, + filterOS = gOPS ? function (self) { + return gOPS(self).filter(pIE, self); + } : function () { + return Array.prototype; + }; + + return function assign(where) { + if (gOPS && !(where instanceof O)) { + console.warn('problematic Symbols', where); + } - return function assign(where) { - if (gOPS && !(where instanceof O)) { - console.warn('problematic Symbols', where); - } + function set(keyOrSymbol) { + where[keyOrSymbol] = arg[keyOrSymbol]; + } - function set(keyOrSymbol) { - where[keyOrSymbol] = arg[keyOrSymbol]; - } + for (var i = 1, ii = arguments.length; i < ii; ++i) { + var arg = arguments[i]; - for (var i = 1, ii = arguments.length; i < ii; ++i) { - var arg = arguments[i]; + if (arg === null || arg === undefined) { + continue; + } - if (arg === null || arg === undefined) { - continue; + O.keys(arg).concat(filterOS(arg)).forEach(set); } - O.keys(arg).concat(filterOS(arg)).forEach(set); - } + return where; + }; + }() + }); + })(Object); +} - return where; - }; - }() - }); -})(Object); +if (typeof FEATURE_NO_ES2015 === 'undefined') { -(function (global) { - var i; + (function (global) { + var i; - var defineProperty = Object.defineProperty, - is = function (a, b) { - return a === b || a !== a && b !== b; - }; + var defineProperty = Object.defineProperty, + is = function (a, b) { + return a === b || a !== a && b !== b; + }; - if (typeof WeakMap == 'undefined') { - global.WeakMap = createCollection({ - 'delete': sharedDelete, + if (typeof WeakMap == 'undefined') { + global.WeakMap = createCollection({ + 'delete': sharedDelete, - clear: sharedClear, + clear: sharedClear, - get: sharedGet, + get: sharedGet, - has: mapHas, + has: mapHas, - set: sharedSet - }, true); - } + set: sharedSet + }, true); + } - if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) { - global.Map = createCollection({ - 'delete': sharedDelete, + if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) { + global.Map = createCollection({ + 'delete': sharedDelete, - has: mapHas, + has: mapHas, - get: sharedGet, + get: sharedGet, - set: sharedSet, + set: sharedSet, - keys: sharedKeys, + keys: sharedKeys, - values: sharedValues, + values: sharedValues, - entries: mapEntries, + entries: mapEntries, - forEach: sharedForEach, + forEach: sharedForEach, - clear: sharedClear, + clear: sharedClear, - [Symbol.iterator]: mapEntries - }); - } + [Symbol.iterator]: mapEntries + }); + } - if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) { - global.Set = createCollection({ - has: setHas, + if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) { + global.Set = createCollection({ + has: setHas, - add: sharedAdd, + add: sharedAdd, - 'delete': sharedDelete, + 'delete': sharedDelete, - clear: sharedClear, + clear: sharedClear, - keys: sharedValues, - values: sharedValues, + keys: sharedValues, + values: sharedValues, - entries: setEntries, + entries: setEntries, - forEach: sharedForEach, + forEach: sharedForEach, - [Symbol.iterator]: sharedValues - }); - } + [Symbol.iterator]: sharedValues + }); + } - if (typeof WeakSet == 'undefined') { - global.WeakSet = createCollection({ - 'delete': sharedDelete, + if (typeof WeakSet == 'undefined') { + global.WeakSet = createCollection({ + 'delete': sharedDelete, - add: sharedAdd, + add: sharedAdd, - clear: sharedClear, + clear: sharedClear, - has: setHas - }, true); - } + has: setHas + }, true); + } + + function createCollection(proto, objectOnly) { + function Collection(a) { + if (!this || this.constructor !== Collection) return new Collection(a); + this._keys = []; + this._values = []; + this._itp = []; + this.objectOnly = objectOnly; + + if (a) init.call(this, a); + } + + if (!objectOnly) { + defineProperty(proto, 'size', { + get: sharedSize + }); + } - function createCollection(proto, objectOnly) { - function Collection(a) { - if (!this || this.constructor !== Collection) return new Collection(a); - this._keys = []; - this._values = []; - this._itp = []; - this.objectOnly = objectOnly; + proto.constructor = Collection; + Collection.prototype = proto; - if (a) init.call(this, a); + return Collection; } - if (!objectOnly) { - defineProperty(proto, 'size', { - get: sharedSize - }); + function init(a) { + var i; + + if (this.add) a.forEach(this.add, this);else a.forEach(function (a) { + this.set(a[0], a[1]); + }, this); } - proto.constructor = Collection; - Collection.prototype = proto; + function sharedDelete(key) { + if (this.has(key)) { + this._keys.splice(i, 1); + this._values.splice(i, 1); - return Collection; - } + this._itp.forEach(function (p) { + if (i < p[0]) p[0]--; + }); + } - function init(a) { - var i; + return -1 < i; + }; - if (this.add) a.forEach(this.add, this);else a.forEach(function (a) { - this.set(a[0], a[1]); - }, this); - } + function sharedGet(key) { + return this.has(key) ? this._values[i] : undefined; + } - function sharedDelete(key) { - if (this.has(key)) { - this._keys.splice(i, 1); - this._values.splice(i, 1); + function has(list, key) { + if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key"); - this._itp.forEach(function (p) { - if (i < p[0]) p[0]--; - }); + if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key); + return -1 < i; } - return -1 < i; - }; + function setHas(value) { + return has.call(this, this._values, value); + } - function sharedGet(key) { - return this.has(key) ? this._values[i] : undefined; - } + function mapHas(value) { + return has.call(this, this._keys, value); + } - function has(list, key) { - if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key"); + function sharedSet(key, value) { + this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; + return this; + } - if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key); - return -1 < i; - } + function sharedAdd(value) { + if (!this.has(value)) this._values.push(value); + return this; + } - function setHas(value) { - return has.call(this, this._values, value); - } + function sharedClear() { + (this._keys || 0).length = this._values.length = 0; + } - function mapHas(value) { - return has.call(this, this._keys, value); - } + function sharedKeys() { + return sharedIterator(this._itp, this._keys); + } - function sharedSet(key, value) { - this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; - return this; - } + function sharedValues() { + return sharedIterator(this._itp, this._values); + } - function sharedAdd(value) { - if (!this.has(value)) this._values.push(value); - return this; - } + function mapEntries() { + return sharedIterator(this._itp, this._keys, this._values); + } - function sharedClear() { - (this._keys || 0).length = this._values.length = 0; - } + function setEntries() { + return sharedIterator(this._itp, this._values, this._values); + } - function sharedKeys() { - return sharedIterator(this._itp, this._keys); - } + function sharedIterator(itp, array, array2) { + var p = [0], + done = false; + itp.push(p); + return { + [Symbol.iterator]: function () { + return this; + }, + next: function () { + var v, + k = p[0]; + if (!done && k < array.length) { + v = array2 ? [array[k], array2[k]] : array[k]; + p[0]++; + } else { + done = true; + itp.splice(itp.indexOf(p), 1); + } + return { done: done, value: v }; + } + }; + } - function sharedValues() { - return sharedIterator(this._itp, this._values); - } + function sharedSize() { + return this._values.length; + } - function mapEntries() { - return sharedIterator(this._itp, this._keys, this._values); - } + function sharedForEach(callback, context) { + var it = this.entries(); + for (;;) { + var r = it.next(); + if (r.done) break; + callback.call(context, r.value[1], r.value[0], this); + } + } + })(PLATFORM.global); +} + +if (typeof FEATURE_NO_ES2015 === 'undefined') { - function setEntries() { - return sharedIterator(this._itp, this._values, this._values); + const bind = Function.prototype.bind; + + if (typeof PLATFORM.global.Reflect === 'undefined') { + PLATFORM.global.Reflect = {}; } - function sharedIterator(itp, array, array2) { - var p = [0], - done = false; - itp.push(p); - return { - [Symbol.iterator]: function () { - return this; - }, - next: function () { - var v, - k = p[0]; - if (!done && k < array.length) { - v = array2 ? [array[k], array2[k]] : array[k]; - p[0]++; - } else { - done = true; - itp.splice(itp.indexOf(p), 1); - } - return { done: done, value: v }; + if (typeof Reflect.defineProperty !== 'function') { + Reflect.defineProperty = function (target, propertyKey, descriptor) { + if (typeof target === 'object' ? target === null : typeof target !== 'function') { + throw new TypeError('Reflect.defineProperty called on non-object'); + } + try { + Object.defineProperty(target, propertyKey, descriptor); + return true; + } catch (e) { + return false; } }; } - function sharedSize() { - return this._values.length; - } + if (typeof Reflect.construct !== 'function') { + Reflect.construct = function (Target, args) { + if (args) { + switch (args.length) { + case 0: + return new Target(); + case 1: + return new Target(args[0]); + case 2: + return new Target(args[0], args[1]); + case 3: + return new Target(args[0], args[1], args[2]); + case 4: + return new Target(args[0], args[1], args[2], args[3]); + } + } - function sharedForEach(callback, context) { - var it = this.entries(); - for (;;) { - var r = it.next(); - if (r.done) break; - callback.call(context, r.value[1], r.value[0], this); - } + var a = [null]; + a.push.apply(a, args); + return new (bind.apply(Target, a))(); + }; } -})(PLATFORM.global); -const emptyMetadata = Object.freeze({}); -const metadataContainerKey = '__metadata__'; -const bind = Function.prototype.bind; - -if (typeof PLATFORM.global.Reflect === 'undefined') { - PLATFORM.global.Reflect = {}; -} - -if (typeof Reflect.getOwnMetadata !== 'function') { - Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { - if (target.hasOwnProperty(metadataContainerKey)) { - return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; - } - }; -} - -if (typeof Reflect.defineMetadata !== 'function') { - Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) { - let metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {}; - let targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); - targetContainer[metadataKey] = metadataValue; - }; -} - -if (typeof Reflect.metadata !== 'function') { - Reflect.metadata = function (metadataKey, metadataValue) { - return function (target, targetKey) { - Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); + if (typeof Reflect.ownKeys !== 'function') { + Reflect.ownKeys = function (o) { + return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o)); }; - }; + } } -if (typeof Reflect.defineProperty !== 'function') { - Reflect.defineProperty = function (target, propertyKey, descriptor) { - if (typeof target === 'object' ? target === null : typeof target !== 'function') { - throw new TypeError('Reflect.defineProperty called on non-object'); - } - try { - Object.defineProperty(target, propertyKey, descriptor); - return true; - } catch (e) { - return false; - } - }; -} +if (typeof FEATURE_NO_ESNEXT === 'undefined') { + + const emptyMetadata = Object.freeze({}); + const metadataContainerKey = '__metadata__'; -if (typeof Reflect.construct !== 'function') { - Reflect.construct = function (Target, args) { - if (args) { - switch (args.length) { - case 0: - return new Target(); - case 1: - return new Target(args[0]); - case 2: - return new Target(args[0], args[1]); - case 3: - return new Target(args[0], args[1], args[2]); - case 4: - return new Target(args[0], args[1], args[2], args[3]); + if (typeof Reflect.getOwnMetadata !== 'function') { + Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { + if (target.hasOwnProperty(metadataContainerKey)) { + return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; } - } + }; + } - var a = [null]; - a.push.apply(a, args); - return new (bind.apply(Target, a))(); - }; -} + if (typeof Reflect.defineMetadata !== 'function') { + Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) { + let metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {}; + let targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); + targetContainer[metadataKey] = metadataValue; + }; + } -if (typeof Reflect.ownKeys !== 'function') { - Reflect.ownKeys = function (o) { - return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o)); - }; + if (typeof Reflect.metadata !== 'function') { + Reflect.metadata = function (metadataKey, metadataValue) { + return function (target, targetKey) { + Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); + }; + }; + } } \ No newline at end of file diff --git a/dist/native-modules/aurelia-polyfills.js b/dist/native-modules/aurelia-polyfills.js index 504848a..95e52e8 100644 --- a/dist/native-modules/aurelia-polyfills.js +++ b/dist/native-modules/aurelia-polyfills.js @@ -2,266 +2,273 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol import { PLATFORM } from 'aurelia-pal'; -(function (Object, GOPS) { - 'use strict'; - - if (GOPS in Object) return; - - var setDescriptor, - G = PLATFORM.global, - id = 0, - random = '' + Math.random(), - prefix = '__\x01symbol:', - prefixLength = prefix.length, - internalSymbol = '__\x01symbol@@' + random, - DP = 'defineProperty', - DPies = 'defineProperties', - GOPN = 'getOwnPropertyNames', - GOPD = 'getOwnPropertyDescriptor', - PIE = 'propertyIsEnumerable', - gOPN = Object[GOPN], - gOPD = Object[GOPD], - create = Object.create, - keys = Object.keys, - defineProperty = Object[DP], - $defineProperties = Object[DPies], - descriptor = gOPD(Object, GOPN), - ObjectProto = Object.prototype, - hOP = ObjectProto.hasOwnProperty, - pIE = ObjectProto[PIE], - toString = ObjectProto.toString, - indexOf = Array.prototype.indexOf || function (v) { - for (var i = this.length; i-- && this[i] !== v;) {} - return i; - }, - addInternalIfNeeded = function addInternalIfNeeded(o, uid, enumerable) { - if (!hOP.call(o, internalSymbol)) { - defineProperty(o, internalSymbol, { - enumerable: false, - configurable: false, - writable: false, - value: {} - }); - } - o[internalSymbol]['@@' + uid] = enumerable; - }, - createWithSymbols = function createWithSymbols(proto, descriptors) { - var self = create(proto); - gOPN(descriptors).forEach(function (key) { - if (propertyIsEnumerable.call(descriptors, key)) { - $defineProperty(self, key, descriptors[key]); - } - }); - return self; - }, - copyAsNonEnumerable = function copyAsNonEnumerable(descriptor) { - var newDescriptor = create(descriptor); - newDescriptor.enumerable = false; - return newDescriptor; - }, - get = function get() {}, - onlyNonSymbols = function onlyNonSymbols(name) { - return name != internalSymbol && !hOP.call(source, name); - }, - onlySymbols = function onlySymbols(name) { - return name != internalSymbol && hOP.call(source, name); - }, - propertyIsEnumerable = function propertyIsEnumerable(key) { - var uid = '' + key; - return onlySymbols(uid) ? hOP.call(this, uid) && this[internalSymbol]['@@' + uid] : pIE.call(this, key); - }, - setAndGetSymbol = function setAndGetSymbol(uid) { - var descriptor = { - enumerable: false, - configurable: true, - get: get, - set: function set(value) { - setDescriptor(this, uid, { +if (typeof FEATURE_NO_ES2015 === 'undefined') { + + (function (Object, GOPS) { + 'use strict'; + + if (GOPS in Object) return; + + var setDescriptor, + G = PLATFORM.global, + id = 0, + random = '' + Math.random(), + prefix = '__\x01symbol:', + prefixLength = prefix.length, + internalSymbol = '__\x01symbol@@' + random, + DP = 'defineProperty', + DPies = 'defineProperties', + GOPN = 'getOwnPropertyNames', + GOPD = 'getOwnPropertyDescriptor', + PIE = 'propertyIsEnumerable', + gOPN = Object[GOPN], + gOPD = Object[GOPD], + create = Object.create, + keys = Object.keys, + defineProperty = Object[DP], + $defineProperties = Object[DPies], + descriptor = gOPD(Object, GOPN), + ObjectProto = Object.prototype, + hOP = ObjectProto.hasOwnProperty, + pIE = ObjectProto[PIE], + toString = ObjectProto.toString, + indexOf = Array.prototype.indexOf || function (v) { + for (var i = this.length; i-- && this[i] !== v;) {} + return i; + }, + addInternalIfNeeded = function addInternalIfNeeded(o, uid, enumerable) { + if (!hOP.call(o, internalSymbol)) { + defineProperty(o, internalSymbol, { enumerable: false, - configurable: true, - writable: true, - value: value + configurable: false, + writable: false, + value: {} }); - addInternalIfNeeded(this, uid, true); } - }; - defineProperty(ObjectProto, uid, descriptor); - return source[uid] = defineProperty(Object(uid), 'constructor', sourceConstructor); - }, - _Symbol = function _Symbol2(description) { - if (this && this !== G) { - throw new TypeError('Symbol is not a constructor'); - } - return setAndGetSymbol(prefix.concat(description || '', random, ++id)); - }, - source = create(null), - sourceConstructor = { value: _Symbol }, - sourceMap = function sourceMap(uid) { - return source[uid]; - }, - $defineProperty = function defineProp(o, key, descriptor) { - var uid = '' + key; - if (onlySymbols(uid)) { - setDescriptor(o, uid, descriptor.enumerable ? copyAsNonEnumerable(descriptor) : descriptor); - addInternalIfNeeded(o, uid, !!descriptor.enumerable); - } else { - defineProperty(o, key, descriptor); - } - return o; - }, - $getOwnPropertySymbols = function getOwnPropertySymbols(o) { - var cof = toString.call(o); - o = cof === '[object String]' ? o.split('') : Object(o); - return gOPN(o).filter(onlySymbols).map(sourceMap); - }; - - descriptor.value = $defineProperty; - defineProperty(Object, DP, descriptor); - - descriptor.value = $getOwnPropertySymbols; - defineProperty(Object, GOPS, descriptor); - - descriptor.value = function getOwnPropertyNames(o) { - return gOPN(o).filter(onlyNonSymbols); - }; - defineProperty(Object, GOPN, descriptor); - - descriptor.value = function defineProperties(o, descriptors) { - var symbols = $getOwnPropertySymbols(descriptors); - if (symbols.length) { - keys(descriptors).concat(symbols).forEach(function (uid) { - if (propertyIsEnumerable.call(descriptors, uid)) { - $defineProperty(o, uid, descriptors[uid]); + o[internalSymbol]['@@' + uid] = enumerable; + }, + createWithSymbols = function createWithSymbols(proto, descriptors) { + var self = create(proto); + gOPN(descriptors).forEach(function (key) { + if (propertyIsEnumerable.call(descriptors, key)) { + $defineProperty(self, key, descriptors[key]); } }); - } else { - $defineProperties(o, descriptors); - } - return o; - }; - defineProperty(Object, DPies, descriptor); + return self; + }, + copyAsNonEnumerable = function copyAsNonEnumerable(descriptor) { + var newDescriptor = create(descriptor); + newDescriptor.enumerable = false; + return newDescriptor; + }, + get = function get() {}, + onlyNonSymbols = function onlyNonSymbols(name) { + return name != internalSymbol && !hOP.call(source, name); + }, + onlySymbols = function onlySymbols(name) { + return name != internalSymbol && hOP.call(source, name); + }, + propertyIsEnumerable = function propertyIsEnumerable(key) { + var uid = '' + key; + return onlySymbols(uid) ? hOP.call(this, uid) && this[internalSymbol]['@@' + uid] : pIE.call(this, key); + }, + setAndGetSymbol = function setAndGetSymbol(uid) { + var descriptor = { + enumerable: false, + configurable: true, + get: get, + set: function set(value) { + setDescriptor(this, uid, { + enumerable: false, + configurable: true, + writable: true, + value: value + }); + addInternalIfNeeded(this, uid, true); + } + }; + defineProperty(ObjectProto, uid, descriptor); + return source[uid] = defineProperty(Object(uid), 'constructor', sourceConstructor); + }, + _Symbol = function _Symbol2(description) { + if (this && this !== G) { + throw new TypeError('Symbol is not a constructor'); + } + return setAndGetSymbol(prefix.concat(description || '', random, ++id)); + }, + source = create(null), + sourceConstructor = { value: _Symbol }, + sourceMap = function sourceMap(uid) { + return source[uid]; + }, + $defineProperty = function defineProp(o, key, descriptor) { + var uid = '' + key; + if (onlySymbols(uid)) { + setDescriptor(o, uid, descriptor.enumerable ? copyAsNonEnumerable(descriptor) : descriptor); + addInternalIfNeeded(o, uid, !!descriptor.enumerable); + } else { + defineProperty(o, key, descriptor); + } + return o; + }, + $getOwnPropertySymbols = function getOwnPropertySymbols(o) { + var cof = toString.call(o); + o = cof === '[object String]' ? o.split('') : Object(o); + return gOPN(o).filter(onlySymbols).map(sourceMap); + }; - descriptor.value = propertyIsEnumerable; - defineProperty(ObjectProto, PIE, descriptor); + descriptor.value = $defineProperty; + defineProperty(Object, DP, descriptor); - descriptor.value = _Symbol; - defineProperty(G, 'Symbol', descriptor); + descriptor.value = $getOwnPropertySymbols; + defineProperty(Object, GOPS, descriptor); - descriptor.value = function (key) { - var uid = prefix.concat(prefix, key, random); - return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid); - }; - defineProperty(_Symbol, 'for', descriptor); + descriptor.value = function getOwnPropertyNames(o) { + return gOPN(o).filter(onlyNonSymbols); + }; + defineProperty(Object, GOPN, descriptor); + + descriptor.value = function defineProperties(o, descriptors) { + var symbols = $getOwnPropertySymbols(descriptors); + if (symbols.length) { + keys(descriptors).concat(symbols).forEach(function (uid) { + if (propertyIsEnumerable.call(descriptors, uid)) { + $defineProperty(o, uid, descriptors[uid]); + } + }); + } else { + $defineProperties(o, descriptors); + } + return o; + }; + defineProperty(Object, DPies, descriptor); - descriptor.value = function (symbol) { - return hOP.call(source, symbol) ? symbol.slice(prefixLength * 2, -random.length) : void 0; - }; - defineProperty(_Symbol, 'keyFor', descriptor); + descriptor.value = propertyIsEnumerable; + defineProperty(ObjectProto, PIE, descriptor); - descriptor.value = function getOwnPropertyDescriptor(o, key) { - var descriptor = gOPD(o, key); - if (descriptor && onlySymbols(key)) { - descriptor.enumerable = propertyIsEnumerable.call(o, key); - } - return descriptor; - }; - defineProperty(Object, GOPD, descriptor); + descriptor.value = _Symbol; + defineProperty(G, 'Symbol', descriptor); - descriptor.value = function (proto, descriptors) { - return arguments.length === 1 ? create(proto) : createWithSymbols(proto, descriptors); - }; - defineProperty(Object, 'create', descriptor); + descriptor.value = function (key) { + var uid = prefix.concat(prefix, key, random); + return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid); + }; + defineProperty(_Symbol, 'for', descriptor); - descriptor.value = function () { - var str = toString.call(this); - return str === '[object String]' && onlySymbols(this) ? '[object Symbol]' : str; - }; - defineProperty(ObjectProto, 'toString', descriptor); + descriptor.value = function (symbol) { + return hOP.call(source, symbol) ? symbol.slice(prefixLength * 2, -random.length) : void 0; + }; + defineProperty(_Symbol, 'keyFor', descriptor); - try { - setDescriptor = create(defineProperty({}, prefix, { - get: function get() { - return defineProperty(this, prefix, { value: false })[prefix]; + descriptor.value = function getOwnPropertyDescriptor(o, key) { + var descriptor = gOPD(o, key); + if (descriptor && onlySymbols(key)) { + descriptor.enumerable = propertyIsEnumerable.call(o, key); } - }))[prefix] || defineProperty; - } catch (o_O) { - setDescriptor = function setDescriptor(o, key, descriptor) { - var protoDescriptor = gOPD(ObjectProto, key); - delete ObjectProto[key]; - defineProperty(o, key, descriptor); - defineProperty(ObjectProto, key, protoDescriptor); + return descriptor; }; - } -})(Object, 'getOwnPropertySymbols'); - -(function (O, S) { - var dP = O.defineProperty, - ObjectProto = O.prototype, - toString = ObjectProto.toString, - toStringTag = 'toStringTag', - descriptor; - ['iterator', 'match', 'replace', 'search', 'split', 'hasInstance', 'isConcatSpreadable', 'unscopables', 'species', 'toPrimitive', toStringTag].forEach(function (name) { - if (!(name in Symbol)) { - dP(Symbol, name, { value: Symbol(name) }); - switch (name) { - case toStringTag: - descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); - descriptor.value = function () { - var str = toString.call(this), - tst = typeof this === 'undefined' || this === null ? undefined : this[Symbol.toStringTag]; - return typeof tst === 'undefined' ? str : '[object ' + tst + ']'; - }; - dP(ObjectProto, 'toString', descriptor); - break; - } - } - }); -})(Object, Symbol); + defineProperty(Object, GOPD, descriptor); -(function (Si, AP, SP) { + descriptor.value = function (proto, descriptors) { + return arguments.length === 1 ? create(proto) : createWithSymbols(proto, descriptors); + }; + defineProperty(Object, 'create', descriptor); - function returnThis() { - return this; - } + descriptor.value = function () { + var str = toString.call(this); + return str === '[object String]' && onlySymbols(this) ? '[object Symbol]' : str; + }; + defineProperty(ObjectProto, 'toString', descriptor); - if (!AP[Si]) AP[Si] = function () { - var i = 0, - self = this, - iterator = { - next: function next() { - var done = self.length <= i; - return done ? { done: done } : { done: done, value: self[i++] }; + try { + setDescriptor = create(defineProperty({}, prefix, { + get: function get() { + return defineProperty(this, prefix, { value: false })[prefix]; + } + }))[prefix] || defineProperty; + } catch (o_O) { + setDescriptor = function setDescriptor(o, key, descriptor) { + var protoDescriptor = gOPD(ObjectProto, key); + delete ObjectProto[key]; + defineProperty(o, key, descriptor); + defineProperty(ObjectProto, key, protoDescriptor); + }; + } + })(Object, 'getOwnPropertySymbols'); + + (function (O, S) { + var dP = O.defineProperty, + ObjectProto = O.prototype, + toString = ObjectProto.toString, + toStringTag = 'toStringTag', + descriptor; + ['iterator', 'match', 'replace', 'search', 'split', 'hasInstance', 'isConcatSpreadable', 'unscopables', 'species', 'toPrimitive', toStringTag].forEach(function (name) { + if (!(name in Symbol)) { + dP(Symbol, name, { value: Symbol(name) }); + switch (name) { + case toStringTag: + descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); + descriptor.value = function () { + var str = toString.call(this), + tst = typeof this === 'undefined' || this === null ? undefined : this[Symbol.toStringTag]; + return typeof tst === 'undefined' ? str : '[object ' + tst + ']'; + }; + dP(ObjectProto, 'toString', descriptor); + break; + } } + }); + })(Object, Symbol); + + (function (Si, AP, SP) { + + function returnThis() { + return this; + } + + if (!AP[Si]) AP[Si] = function () { + var i = 0, + self = this, + iterator = { + next: function next() { + var done = self.length <= i; + return done ? { done: done } : { done: done, value: self[i++] }; + } + }; + iterator[Si] = returnThis; + return iterator; }; - iterator[Si] = returnThis; - return iterator; - }; - if (!SP[Si]) SP[Si] = function () { - var fromCodePoint = String.fromCodePoint, - self = this, - i = 0, - length = self.length, - iterator = { - next: function next() { - var done = length <= i, - c = done ? '' : fromCodePoint(self.codePointAt(i)); - i += c.length; - return done ? { done: done } : { done: done, value: c }; - } + if (!SP[Si]) SP[Si] = function () { + var fromCodePoint = String.fromCodePoint, + self = this, + i = 0, + length = self.length, + iterator = { + next: function next() { + var done = length <= i, + c = done ? '' : fromCodePoint(self.codePointAt(i)); + i += c.length; + return done ? { done: done } : { done: done, value: c }; + } + }; + iterator[Si] = returnThis; + return iterator; }; - iterator[Si] = returnThis; - return iterator; + })(Symbol.iterator, Array.prototype, String.prototype); +} + +if (typeof FEATURE_NO_ES2015 === 'undefined') { + + Number.isNaN = Number.isNaN || function (value) { + return value !== value; }; -})(Symbol.iterator, Array.prototype, String.prototype); -Number.isNaN = Number.isNaN || function (value) { - return value !== value; -}; + Number.isFinite = Number.isFinite || function (value) { + return typeof value === "number" && isFinite(value); + }; +} -Number.isFinite = Number.isFinite || function (value) { - return typeof value === "number" && isFinite(value); -}; if (!String.prototype.endsWith || function () { try { return !"ab".endsWith("a", 1); @@ -293,109 +300,112 @@ if (!String.prototype.startsWith || function () { }; } -if (!Array.from) { - Array.from = function () { - var toInteger = function toInteger(it) { - return isNaN(it = +it) ? 0 : (it > 0 ? Math.floor : Math.ceil)(it); - }; - var toLength = function toLength(it) { - return it > 0 ? Math.min(toInteger(it), 0x1fffffffffffff) : 0; - }; - var iterCall = function iterCall(iter, fn, val, index) { - try { - return fn(val, index); - } catch (E) { - if (typeof iter.return == 'function') iter.return(); - throw E; - } - }; +if (typeof FEATURE_NO_ES2015 === 'undefined') { - return function from(arrayLike) { - var O = Object(arrayLike), - C = typeof this == 'function' ? this : Array, - aLen = arguments.length, - mapfn = aLen > 1 ? arguments[1] : undefined, - mapping = mapfn !== undefined, - index = 0, - iterFn = O[Symbol.iterator], - length, - result, - step, - iterator; - if (mapping) mapfn = mapfn.bind(aLen > 2 ? arguments[2] : undefined); - if (iterFn != undefined && !Array.isArray(arrayLike)) { - for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { - result[index] = mapping ? iterCall(iterator, mapfn, step.value, index) : step.value; + if (!Array.from) { + Array.from = function () { + var toInteger = function toInteger(it) { + return isNaN(it = +it) ? 0 : (it > 0 ? Math.floor : Math.ceil)(it); + }; + var toLength = function toLength(it) { + return it > 0 ? Math.min(toInteger(it), 0x1fffffffffffff) : 0; + }; + var iterCall = function iterCall(iter, fn, val, index) { + try { + return fn(val, index); + } catch (E) { + if (typeof iter.return == 'function') iter.return(); + throw E; } - } else { - length = toLength(O.length); - for (result = new C(length); length > index; index++) { - result[index] = mapping ? mapfn(O[index], index) : O[index]; + }; + + return function from(arrayLike) { + var O = Object(arrayLike), + C = typeof this == 'function' ? this : Array, + aLen = arguments.length, + mapfn = aLen > 1 ? arguments[1] : undefined, + mapping = mapfn !== undefined, + index = 0, + iterFn = O[Symbol.iterator], + length, + result, + step, + iterator; + if (mapping) mapfn = mapfn.bind(aLen > 2 ? arguments[2] : undefined); + if (iterFn != undefined && !Array.isArray(arrayLike)) { + for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { + result[index] = mapping ? iterCall(iterator, mapfn, step.value, index) : step.value; + } + } else { + length = toLength(O.length); + for (result = new C(length); length > index; index++) { + result[index] = mapping ? mapfn(O[index], index) : O[index]; + } } - } - result.length = index; - return result; - }; - }(); -} + result.length = index; + return result; + }; + }(); + } -if (!Array.prototype.find) { - Object.defineProperty(Array.prototype, 'find', { - configurable: true, - writable: true, - enumerable: false, - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.find called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return value; + if (!Array.prototype.find) { + Object.defineProperty(Array.prototype, 'find', { + configurable: true, + writable: true, + enumerable: false, + value: function value(predicate) { + if (this === null) { + throw new TypeError('Array.prototype.find called on null or undefined'); } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return value; + } + } + return undefined; } - return undefined; - } - }); -} + }); + } -if (!Array.prototype.findIndex) { - Object.defineProperty(Array.prototype, 'findIndex', { - configurable: true, - writable: true, - enumerable: false, - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.findIndex called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return i; + if (!Array.prototype.findIndex) { + Object.defineProperty(Array.prototype, 'findIndex', { + configurable: true, + writable: true, + enumerable: false, + value: function value(predicate) { + if (this === null) { + throw new TypeError('Array.prototype.findIndex called on null or undefined'); } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return i; + } + } + return -1; } - return -1; - } - }); + }); + } } -if (!Array.prototype.includes) { +if (typeof FEATURE_NO_ES2016 === 'undefined' && !Array.prototype.includes) { Object.defineProperty(Array.prototype, 'includes', { configurable: true, writable: true, @@ -429,375 +439,392 @@ if (!Array.prototype.includes) { }); } -(function () { - var needsFix = false; +if (typeof FEATURE_NO_ES2015 === 'undefined') { - try { - var s = Object.keys('a'); - needsFix = s.length !== 1 || s[0] !== '0'; - } catch (e) { - needsFix = true; - } + (function () { + var needsFix = false; - if (needsFix) { - Object.keys = function () { - var hasOwnProperty = Object.prototype.hasOwnProperty, - hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'), - dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], - dontEnumsLength = dontEnums.length; + try { + var s = Object.keys('a'); + needsFix = s.length !== 1 || s[0] !== '0'; + } catch (e) { + needsFix = true; + } - return function (obj) { - if (obj === undefined || obj === null) { - throw TypeError('Cannot convert undefined or null to object'); - } + if (needsFix) { + Object.keys = function () { + var hasOwnProperty = Object.prototype.hasOwnProperty, + hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'), + dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], + dontEnumsLength = dontEnums.length; + + return function (obj) { + if (obj === undefined || obj === null) { + throw TypeError('Cannot convert undefined or null to object'); + } - obj = Object(obj); + obj = Object(obj); - var result = [], - prop, - i; + var result = [], + prop, + i; - for (prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - result.push(prop); + for (prop in obj) { + if (hasOwnProperty.call(obj, prop)) { + result.push(prop); + } } - } - if (hasDontEnumBug) { - for (i = 0; i < dontEnumsLength; i++) { - if (hasOwnProperty.call(obj, dontEnums[i])) { - result.push(dontEnums[i]); + if (hasDontEnumBug) { + for (i = 0; i < dontEnumsLength; i++) { + if (hasOwnProperty.call(obj, dontEnums[i])) { + result.push(dontEnums[i]); + } } } - } - return result; - }; - }(); - } -})(); + return result; + }; + }(); + } + })(); -(function (O) { - if ('assign' in O) { - return; - } + (function (O) { + if ('assign' in O) { + return; + } - O.defineProperty(O, 'assign', { - configurable: true, - writable: true, - value: function () { - var gOPS = O.getOwnPropertySymbols, - pIE = O.propertyIsEnumerable, - filterOS = gOPS ? function (self) { - return gOPS(self).filter(pIE, self); - } : function () { - return Array.prototype; - }; + O.defineProperty(O, 'assign', { + configurable: true, + writable: true, + value: function () { + var gOPS = O.getOwnPropertySymbols, + pIE = O.propertyIsEnumerable, + filterOS = gOPS ? function (self) { + return gOPS(self).filter(pIE, self); + } : function () { + return Array.prototype; + }; + + return function assign(where) { + if (gOPS && !(where instanceof O)) { + console.warn('problematic Symbols', where); + } - return function assign(where) { - if (gOPS && !(where instanceof O)) { - console.warn('problematic Symbols', where); - } + function set(keyOrSymbol) { + where[keyOrSymbol] = arg[keyOrSymbol]; + } - function set(keyOrSymbol) { - where[keyOrSymbol] = arg[keyOrSymbol]; - } + for (var i = 1, ii = arguments.length; i < ii; ++i) { + var arg = arguments[i]; - for (var i = 1, ii = arguments.length; i < ii; ++i) { - var arg = arguments[i]; + if (arg === null || arg === undefined) { + continue; + } - if (arg === null || arg === undefined) { - continue; + O.keys(arg).concat(filterOS(arg)).forEach(set); } - O.keys(arg).concat(filterOS(arg)).forEach(set); - } - - return where; - }; - }() - }); -})(Object); - -(function (global) { - var i; + return where; + }; + }() + }); + })(Object); +} - var defineProperty = Object.defineProperty, - is = function is(a, b) { - return a === b || a !== a && b !== b; - }; +if (typeof FEATURE_NO_ES2015 === 'undefined') { - if (typeof WeakMap == 'undefined') { - global.WeakMap = createCollection({ - 'delete': sharedDelete, + (function (global) { + var i; - clear: sharedClear, + var defineProperty = Object.defineProperty, + is = function is(a, b) { + return a === b || a !== a && b !== b; + }; - get: sharedGet, + if (typeof WeakMap == 'undefined') { + global.WeakMap = createCollection({ + 'delete': sharedDelete, - has: mapHas, + clear: sharedClear, - set: sharedSet - }, true); - } + get: sharedGet, - if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) { - var _createCollection; + has: mapHas, - global.Map = createCollection((_createCollection = { - 'delete': sharedDelete, + set: sharedSet + }, true); + } - has: mapHas, + if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) { + var _createCollection; - get: sharedGet, + global.Map = createCollection((_createCollection = { + 'delete': sharedDelete, - set: sharedSet, + has: mapHas, - keys: sharedKeys, + get: sharedGet, - values: sharedValues, + set: sharedSet, - entries: mapEntries, + keys: sharedKeys, - forEach: sharedForEach, + values: sharedValues, - clear: sharedClear - }, _createCollection[Symbol.iterator] = mapEntries, _createCollection)); - } + entries: mapEntries, - if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) { - var _createCollection2; + forEach: sharedForEach, - global.Set = createCollection((_createCollection2 = { - has: setHas, + clear: sharedClear + }, _createCollection[Symbol.iterator] = mapEntries, _createCollection)); + } - add: sharedAdd, + if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) { + var _createCollection2; - 'delete': sharedDelete, + global.Set = createCollection((_createCollection2 = { + has: setHas, - clear: sharedClear, + add: sharedAdd, - keys: sharedValues, - values: sharedValues, + 'delete': sharedDelete, - entries: setEntries, + clear: sharedClear, - forEach: sharedForEach - }, _createCollection2[Symbol.iterator] = sharedValues, _createCollection2)); - } + keys: sharedValues, + values: sharedValues, - if (typeof WeakSet == 'undefined') { - global.WeakSet = createCollection({ - 'delete': sharedDelete, + entries: setEntries, - add: sharedAdd, + forEach: sharedForEach + }, _createCollection2[Symbol.iterator] = sharedValues, _createCollection2)); + } - clear: sharedClear, + if (typeof WeakSet == 'undefined') { + global.WeakSet = createCollection({ + 'delete': sharedDelete, - has: setHas - }, true); - } + add: sharedAdd, - function createCollection(proto, objectOnly) { - function Collection(a) { - if (!this || this.constructor !== Collection) return new Collection(a); - this._keys = []; - this._values = []; - this._itp = []; - this.objectOnly = objectOnly; + clear: sharedClear, - if (a) init.call(this, a); + has: setHas + }, true); } - if (!objectOnly) { - defineProperty(proto, 'size', { - get: sharedSize - }); - } + function createCollection(proto, objectOnly) { + function Collection(a) { + if (!this || this.constructor !== Collection) return new Collection(a); + this._keys = []; + this._values = []; + this._itp = []; + this.objectOnly = objectOnly; - proto.constructor = Collection; - Collection.prototype = proto; + if (a) init.call(this, a); + } - return Collection; - } + if (!objectOnly) { + defineProperty(proto, 'size', { + get: sharedSize + }); + } - function init(a) { - var i; + proto.constructor = Collection; + Collection.prototype = proto; - if (this.add) a.forEach(this.add, this);else a.forEach(function (a) { - this.set(a[0], a[1]); - }, this); - } + return Collection; + } - function sharedDelete(key) { - if (this.has(key)) { - this._keys.splice(i, 1); - this._values.splice(i, 1); + function init(a) { + var i; - this._itp.forEach(function (p) { - if (i < p[0]) p[0]--; - }); + if (this.add) a.forEach(this.add, this);else a.forEach(function (a) { + this.set(a[0], a[1]); + }, this); } - return -1 < i; - }; - - function sharedGet(key) { - return this.has(key) ? this._values[i] : undefined; - } + function sharedDelete(key) { + if (this.has(key)) { + this._keys.splice(i, 1); + this._values.splice(i, 1); - function has(list, key) { - if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key"); + this._itp.forEach(function (p) { + if (i < p[0]) p[0]--; + }); + } - if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key); - return -1 < i; - } + return -1 < i; + }; - function setHas(value) { - return has.call(this, this._values, value); - } + function sharedGet(key) { + return this.has(key) ? this._values[i] : undefined; + } - function mapHas(value) { - return has.call(this, this._keys, value); - } + function has(list, key) { + if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key"); - function sharedSet(key, value) { - this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; - return this; - } + if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key); + return -1 < i; + } - function sharedAdd(value) { - if (!this.has(value)) this._values.push(value); - return this; - } + function setHas(value) { + return has.call(this, this._values, value); + } - function sharedClear() { - (this._keys || 0).length = this._values.length = 0; - } + function mapHas(value) { + return has.call(this, this._keys, value); + } - function sharedKeys() { - return sharedIterator(this._itp, this._keys); - } + function sharedSet(key, value) { + this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; + return this; + } - function sharedValues() { - return sharedIterator(this._itp, this._values); - } + function sharedAdd(value) { + if (!this.has(value)) this._values.push(value); + return this; + } - function mapEntries() { - return sharedIterator(this._itp, this._keys, this._values); - } + function sharedClear() { + (this._keys || 0).length = this._values.length = 0; + } - function setEntries() { - return sharedIterator(this._itp, this._values, this._values); - } + function sharedKeys() { + return sharedIterator(this._itp, this._keys); + } - function sharedIterator(itp, array, array2) { - var _ref; + function sharedValues() { + return sharedIterator(this._itp, this._values); + } - var p = [0], - done = false; - itp.push(p); - return _ref = {}, _ref[Symbol.iterator] = function () { - return this; - }, _ref.next = function next() { - var v, - k = p[0]; - if (!done && k < array.length) { - v = array2 ? [array[k], array2[k]] : array[k]; - p[0]++; - } else { - done = true; - itp.splice(itp.indexOf(p), 1); - } - return { done: done, value: v }; - }, _ref; - } + function mapEntries() { + return sharedIterator(this._itp, this._keys, this._values); + } - function sharedSize() { - return this._values.length; - } + function setEntries() { + return sharedIterator(this._itp, this._values, this._values); + } - function sharedForEach(callback, context) { - var it = this.entries(); - for (;;) { - var r = it.next(); - if (r.done) break; - callback.call(context, r.value[1], r.value[0], this); + function sharedIterator(itp, array, array2) { + var _ref; + + var p = [0], + done = false; + itp.push(p); + return _ref = {}, _ref[Symbol.iterator] = function () { + return this; + }, _ref.next = function next() { + var v, + k = p[0]; + if (!done && k < array.length) { + v = array2 ? [array[k], array2[k]] : array[k]; + p[0]++; + } else { + done = true; + itp.splice(itp.indexOf(p), 1); + } + return { done: done, value: v }; + }, _ref; } - } -})(PLATFORM.global); -var emptyMetadata = Object.freeze({}); -var metadataContainerKey = '__metadata__'; -var bind = Function.prototype.bind; + function sharedSize() { + return this._values.length; + } -if (typeof PLATFORM.global.Reflect === 'undefined') { - PLATFORM.global.Reflect = {}; + function sharedForEach(callback, context) { + var it = this.entries(); + for (;;) { + var r = it.next(); + if (r.done) break; + callback.call(context, r.value[1], r.value[0], this); + } + } + })(PLATFORM.global); } -if (typeof Reflect.getOwnMetadata !== 'function') { - Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { - if (target.hasOwnProperty(metadataContainerKey)) { - return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; +if (typeof FEATURE_NO_ES2015 === 'undefined') { + (function () { + + var bind = Function.prototype.bind; + + if (typeof PLATFORM.global.Reflect === 'undefined') { + PLATFORM.global.Reflect = {}; } - }; -} -if (typeof Reflect.defineMetadata !== 'function') { - Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) { - var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {}; - var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); - targetContainer[metadataKey] = metadataValue; - }; -} + if (typeof Reflect.defineProperty !== 'function') { + Reflect.defineProperty = function (target, propertyKey, descriptor) { + if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' ? target === null : typeof target !== 'function') { + throw new TypeError('Reflect.defineProperty called on non-object'); + } + try { + Object.defineProperty(target, propertyKey, descriptor); + return true; + } catch (e) { + return false; + } + }; + } -if (typeof Reflect.metadata !== 'function') { - Reflect.metadata = function (metadataKey, metadataValue) { - return function (target, targetKey) { - Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); - }; - }; -} + if (typeof Reflect.construct !== 'function') { + Reflect.construct = function (Target, args) { + if (args) { + switch (args.length) { + case 0: + return new Target(); + case 1: + return new Target(args[0]); + case 2: + return new Target(args[0], args[1]); + case 3: + return new Target(args[0], args[1], args[2]); + case 4: + return new Target(args[0], args[1], args[2], args[3]); + } + } -if (typeof Reflect.defineProperty !== 'function') { - Reflect.defineProperty = function (target, propertyKey, descriptor) { - if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' ? target === null : typeof target !== 'function') { - throw new TypeError('Reflect.defineProperty called on non-object'); + var a = [null]; + a.push.apply(a, args); + return new (bind.apply(Target, a))(); + }; } - try { - Object.defineProperty(target, propertyKey, descriptor); - return true; - } catch (e) { - return false; + + if (typeof Reflect.ownKeys !== 'function') { + Reflect.ownKeys = function (o) { + return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o)); + }; } - }; + })(); } -if (typeof Reflect.construct !== 'function') { - Reflect.construct = function (Target, args) { - if (args) { - switch (args.length) { - case 0: - return new Target(); - case 1: - return new Target(args[0]); - case 2: - return new Target(args[0], args[1]); - case 3: - return new Target(args[0], args[1], args[2]); - case 4: - return new Target(args[0], args[1], args[2], args[3]); - } +if (typeof FEATURE_NO_ESNEXT === 'undefined') { + (function () { + + var emptyMetadata = Object.freeze({}); + var metadataContainerKey = '__metadata__'; + + if (typeof Reflect.getOwnMetadata !== 'function') { + Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { + if (target.hasOwnProperty(metadataContainerKey)) { + return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; + } + }; } - var a = [null]; - a.push.apply(a, args); - return new (bind.apply(Target, a))(); - }; -} + if (typeof Reflect.defineMetadata !== 'function') { + Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) { + var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {}; + var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); + targetContainer[metadataKey] = metadataValue; + }; + } -if (typeof Reflect.ownKeys !== 'function') { - Reflect.ownKeys = function (o) { - return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o)); - }; + if (typeof Reflect.metadata !== 'function') { + Reflect.metadata = function (metadataKey, metadataValue) { + return function (target, targetKey) { + Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); + }; + }; + } + })(); } \ No newline at end of file diff --git a/dist/system/aurelia-polyfills.js b/dist/system/aurelia-polyfills.js index c42b63c..e8b0907 100644 --- a/dist/system/aurelia-polyfills.js +++ b/dist/system/aurelia-polyfills.js @@ -3,7 +3,7 @@ System.register(['aurelia-pal'], function (_export, _context) { "use strict"; - var PLATFORM, _typeof, emptyMetadata, metadataContainerKey, bind; + var PLATFORM, _typeof; return { setters: [function (_aureliaPal) { @@ -17,266 +17,273 @@ System.register(['aurelia-pal'], function (_export, _context) { }; - (function (Object, GOPS) { - 'use strict'; - - if (GOPS in Object) return; - - var setDescriptor, - G = PLATFORM.global, - id = 0, - random = '' + Math.random(), - prefix = '__\x01symbol:', - prefixLength = prefix.length, - internalSymbol = '__\x01symbol@@' + random, - DP = 'defineProperty', - DPies = 'defineProperties', - GOPN = 'getOwnPropertyNames', - GOPD = 'getOwnPropertyDescriptor', - PIE = 'propertyIsEnumerable', - gOPN = Object[GOPN], - gOPD = Object[GOPD], - create = Object.create, - keys = Object.keys, - defineProperty = Object[DP], - $defineProperties = Object[DPies], - descriptor = gOPD(Object, GOPN), - ObjectProto = Object.prototype, - hOP = ObjectProto.hasOwnProperty, - pIE = ObjectProto[PIE], - toString = ObjectProto.toString, - indexOf = Array.prototype.indexOf || function (v) { - for (var i = this.length; i-- && this[i] !== v;) {} - return i; - }, - addInternalIfNeeded = function addInternalIfNeeded(o, uid, enumerable) { - if (!hOP.call(o, internalSymbol)) { - defineProperty(o, internalSymbol, { - enumerable: false, - configurable: false, - writable: false, - value: {} - }); - } - o[internalSymbol]['@@' + uid] = enumerable; - }, - createWithSymbols = function createWithSymbols(proto, descriptors) { - var self = create(proto); - gOPN(descriptors).forEach(function (key) { - if (propertyIsEnumerable.call(descriptors, key)) { - $defineProperty(self, key, descriptors[key]); - } - }); - return self; - }, - copyAsNonEnumerable = function copyAsNonEnumerable(descriptor) { - var newDescriptor = create(descriptor); - newDescriptor.enumerable = false; - return newDescriptor; - }, - get = function get() {}, - onlyNonSymbols = function onlyNonSymbols(name) { - return name != internalSymbol && !hOP.call(source, name); - }, - onlySymbols = function onlySymbols(name) { - return name != internalSymbol && hOP.call(source, name); - }, - propertyIsEnumerable = function propertyIsEnumerable(key) { - var uid = '' + key; - return onlySymbols(uid) ? hOP.call(this, uid) && this[internalSymbol]['@@' + uid] : pIE.call(this, key); - }, - setAndGetSymbol = function setAndGetSymbol(uid) { - var descriptor = { - enumerable: false, - configurable: true, - get: get, - set: function set(value) { - setDescriptor(this, uid, { + if (typeof FEATURE_NO_ES2015 === 'undefined') { + + (function (Object, GOPS) { + 'use strict'; + + if (GOPS in Object) return; + + var setDescriptor, + G = PLATFORM.global, + id = 0, + random = '' + Math.random(), + prefix = '__\x01symbol:', + prefixLength = prefix.length, + internalSymbol = '__\x01symbol@@' + random, + DP = 'defineProperty', + DPies = 'defineProperties', + GOPN = 'getOwnPropertyNames', + GOPD = 'getOwnPropertyDescriptor', + PIE = 'propertyIsEnumerable', + gOPN = Object[GOPN], + gOPD = Object[GOPD], + create = Object.create, + keys = Object.keys, + defineProperty = Object[DP], + $defineProperties = Object[DPies], + descriptor = gOPD(Object, GOPN), + ObjectProto = Object.prototype, + hOP = ObjectProto.hasOwnProperty, + pIE = ObjectProto[PIE], + toString = ObjectProto.toString, + indexOf = Array.prototype.indexOf || function (v) { + for (var i = this.length; i-- && this[i] !== v;) {} + return i; + }, + addInternalIfNeeded = function addInternalIfNeeded(o, uid, enumerable) { + if (!hOP.call(o, internalSymbol)) { + defineProperty(o, internalSymbol, { enumerable: false, - configurable: true, - writable: true, - value: value + configurable: false, + writable: false, + value: {} }); - addInternalIfNeeded(this, uid, true); } - }; - defineProperty(ObjectProto, uid, descriptor); - return source[uid] = defineProperty(Object(uid), 'constructor', sourceConstructor); - }, - _Symbol = function _Symbol2(description) { - if (this && this !== G) { - throw new TypeError('Symbol is not a constructor'); - } - return setAndGetSymbol(prefix.concat(description || '', random, ++id)); - }, - source = create(null), - sourceConstructor = { value: _Symbol }, - sourceMap = function sourceMap(uid) { - return source[uid]; - }, - $defineProperty = function defineProp(o, key, descriptor) { - var uid = '' + key; - if (onlySymbols(uid)) { - setDescriptor(o, uid, descriptor.enumerable ? copyAsNonEnumerable(descriptor) : descriptor); - addInternalIfNeeded(o, uid, !!descriptor.enumerable); - } else { - defineProperty(o, key, descriptor); - } - return o; - }, - $getOwnPropertySymbols = function getOwnPropertySymbols(o) { - var cof = toString.call(o); - o = cof === '[object String]' ? o.split('') : Object(o); - return gOPN(o).filter(onlySymbols).map(sourceMap); - }; - - descriptor.value = $defineProperty; - defineProperty(Object, DP, descriptor); - - descriptor.value = $getOwnPropertySymbols; - defineProperty(Object, GOPS, descriptor); - - descriptor.value = function getOwnPropertyNames(o) { - return gOPN(o).filter(onlyNonSymbols); - }; - defineProperty(Object, GOPN, descriptor); - - descriptor.value = function defineProperties(o, descriptors) { - var symbols = $getOwnPropertySymbols(descriptors); - if (symbols.length) { - keys(descriptors).concat(symbols).forEach(function (uid) { - if (propertyIsEnumerable.call(descriptors, uid)) { - $defineProperty(o, uid, descriptors[uid]); + o[internalSymbol]['@@' + uid] = enumerable; + }, + createWithSymbols = function createWithSymbols(proto, descriptors) { + var self = create(proto); + gOPN(descriptors).forEach(function (key) { + if (propertyIsEnumerable.call(descriptors, key)) { + $defineProperty(self, key, descriptors[key]); } }); - } else { - $defineProperties(o, descriptors); - } - return o; - }; - defineProperty(Object, DPies, descriptor); + return self; + }, + copyAsNonEnumerable = function copyAsNonEnumerable(descriptor) { + var newDescriptor = create(descriptor); + newDescriptor.enumerable = false; + return newDescriptor; + }, + get = function get() {}, + onlyNonSymbols = function onlyNonSymbols(name) { + return name != internalSymbol && !hOP.call(source, name); + }, + onlySymbols = function onlySymbols(name) { + return name != internalSymbol && hOP.call(source, name); + }, + propertyIsEnumerable = function propertyIsEnumerable(key) { + var uid = '' + key; + return onlySymbols(uid) ? hOP.call(this, uid) && this[internalSymbol]['@@' + uid] : pIE.call(this, key); + }, + setAndGetSymbol = function setAndGetSymbol(uid) { + var descriptor = { + enumerable: false, + configurable: true, + get: get, + set: function set(value) { + setDescriptor(this, uid, { + enumerable: false, + configurable: true, + writable: true, + value: value + }); + addInternalIfNeeded(this, uid, true); + } + }; + defineProperty(ObjectProto, uid, descriptor); + return source[uid] = defineProperty(Object(uid), 'constructor', sourceConstructor); + }, + _Symbol = function _Symbol2(description) { + if (this && this !== G) { + throw new TypeError('Symbol is not a constructor'); + } + return setAndGetSymbol(prefix.concat(description || '', random, ++id)); + }, + source = create(null), + sourceConstructor = { value: _Symbol }, + sourceMap = function sourceMap(uid) { + return source[uid]; + }, + $defineProperty = function defineProp(o, key, descriptor) { + var uid = '' + key; + if (onlySymbols(uid)) { + setDescriptor(o, uid, descriptor.enumerable ? copyAsNonEnumerable(descriptor) : descriptor); + addInternalIfNeeded(o, uid, !!descriptor.enumerable); + } else { + defineProperty(o, key, descriptor); + } + return o; + }, + $getOwnPropertySymbols = function getOwnPropertySymbols(o) { + var cof = toString.call(o); + o = cof === '[object String]' ? o.split('') : Object(o); + return gOPN(o).filter(onlySymbols).map(sourceMap); + }; - descriptor.value = propertyIsEnumerable; - defineProperty(ObjectProto, PIE, descriptor); + descriptor.value = $defineProperty; + defineProperty(Object, DP, descriptor); - descriptor.value = _Symbol; - defineProperty(G, 'Symbol', descriptor); + descriptor.value = $getOwnPropertySymbols; + defineProperty(Object, GOPS, descriptor); - descriptor.value = function (key) { - var uid = prefix.concat(prefix, key, random); - return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid); - }; - defineProperty(_Symbol, 'for', descriptor); + descriptor.value = function getOwnPropertyNames(o) { + return gOPN(o).filter(onlyNonSymbols); + }; + defineProperty(Object, GOPN, descriptor); + + descriptor.value = function defineProperties(o, descriptors) { + var symbols = $getOwnPropertySymbols(descriptors); + if (symbols.length) { + keys(descriptors).concat(symbols).forEach(function (uid) { + if (propertyIsEnumerable.call(descriptors, uid)) { + $defineProperty(o, uid, descriptors[uid]); + } + }); + } else { + $defineProperties(o, descriptors); + } + return o; + }; + defineProperty(Object, DPies, descriptor); - descriptor.value = function (symbol) { - return hOP.call(source, symbol) ? symbol.slice(prefixLength * 2, -random.length) : void 0; - }; - defineProperty(_Symbol, 'keyFor', descriptor); + descriptor.value = propertyIsEnumerable; + defineProperty(ObjectProto, PIE, descriptor); - descriptor.value = function getOwnPropertyDescriptor(o, key) { - var descriptor = gOPD(o, key); - if (descriptor && onlySymbols(key)) { - descriptor.enumerable = propertyIsEnumerable.call(o, key); - } - return descriptor; - }; - defineProperty(Object, GOPD, descriptor); + descriptor.value = _Symbol; + defineProperty(G, 'Symbol', descriptor); - descriptor.value = function (proto, descriptors) { - return arguments.length === 1 ? create(proto) : createWithSymbols(proto, descriptors); - }; - defineProperty(Object, 'create', descriptor); + descriptor.value = function (key) { + var uid = prefix.concat(prefix, key, random); + return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid); + }; + defineProperty(_Symbol, 'for', descriptor); - descriptor.value = function () { - var str = toString.call(this); - return str === '[object String]' && onlySymbols(this) ? '[object Symbol]' : str; - }; - defineProperty(ObjectProto, 'toString', descriptor); + descriptor.value = function (symbol) { + return hOP.call(source, symbol) ? symbol.slice(prefixLength * 2, -random.length) : void 0; + }; + defineProperty(_Symbol, 'keyFor', descriptor); - try { - setDescriptor = create(defineProperty({}, prefix, { - get: function get() { - return defineProperty(this, prefix, { value: false })[prefix]; + descriptor.value = function getOwnPropertyDescriptor(o, key) { + var descriptor = gOPD(o, key); + if (descriptor && onlySymbols(key)) { + descriptor.enumerable = propertyIsEnumerable.call(o, key); } - }))[prefix] || defineProperty; - } catch (o_O) { - setDescriptor = function setDescriptor(o, key, descriptor) { - var protoDescriptor = gOPD(ObjectProto, key); - delete ObjectProto[key]; - defineProperty(o, key, descriptor); - defineProperty(ObjectProto, key, protoDescriptor); + return descriptor; }; - } - })(Object, 'getOwnPropertySymbols'); - - (function (O, S) { - var dP = O.defineProperty, - ObjectProto = O.prototype, - toString = ObjectProto.toString, - toStringTag = 'toStringTag', - descriptor; - ['iterator', 'match', 'replace', 'search', 'split', 'hasInstance', 'isConcatSpreadable', 'unscopables', 'species', 'toPrimitive', toStringTag].forEach(function (name) { - if (!(name in Symbol)) { - dP(Symbol, name, { value: Symbol(name) }); - switch (name) { - case toStringTag: - descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); - descriptor.value = function () { - var str = toString.call(this), - tst = typeof this === 'undefined' || this === null ? undefined : this[Symbol.toStringTag]; - return typeof tst === 'undefined' ? str : '[object ' + tst + ']'; - }; - dP(ObjectProto, 'toString', descriptor); - break; - } - } - }); - })(Object, Symbol); + defineProperty(Object, GOPD, descriptor); - (function (Si, AP, SP) { + descriptor.value = function (proto, descriptors) { + return arguments.length === 1 ? create(proto) : createWithSymbols(proto, descriptors); + }; + defineProperty(Object, 'create', descriptor); - function returnThis() { - return this; - } + descriptor.value = function () { + var str = toString.call(this); + return str === '[object String]' && onlySymbols(this) ? '[object Symbol]' : str; + }; + defineProperty(ObjectProto, 'toString', descriptor); - if (!AP[Si]) AP[Si] = function () { - var i = 0, - self = this, - iterator = { - next: function next() { - var done = self.length <= i; - return done ? { done: done } : { done: done, value: self[i++] }; + try { + setDescriptor = create(defineProperty({}, prefix, { + get: function get() { + return defineProperty(this, prefix, { value: false })[prefix]; + } + }))[prefix] || defineProperty; + } catch (o_O) { + setDescriptor = function setDescriptor(o, key, descriptor) { + var protoDescriptor = gOPD(ObjectProto, key); + delete ObjectProto[key]; + defineProperty(o, key, descriptor); + defineProperty(ObjectProto, key, protoDescriptor); + }; + } + })(Object, 'getOwnPropertySymbols'); + + (function (O, S) { + var dP = O.defineProperty, + ObjectProto = O.prototype, + toString = ObjectProto.toString, + toStringTag = 'toStringTag', + descriptor; + ['iterator', 'match', 'replace', 'search', 'split', 'hasInstance', 'isConcatSpreadable', 'unscopables', 'species', 'toPrimitive', toStringTag].forEach(function (name) { + if (!(name in Symbol)) { + dP(Symbol, name, { value: Symbol(name) }); + switch (name) { + case toStringTag: + descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); + descriptor.value = function () { + var str = toString.call(this), + tst = typeof this === 'undefined' || this === null ? undefined : this[Symbol.toStringTag]; + return typeof tst === 'undefined' ? str : '[object ' + tst + ']'; + }; + dP(ObjectProto, 'toString', descriptor); + break; + } } + }); + })(Object, Symbol); + + (function (Si, AP, SP) { + + function returnThis() { + return this; + } + + if (!AP[Si]) AP[Si] = function () { + var i = 0, + self = this, + iterator = { + next: function next() { + var done = self.length <= i; + return done ? { done: done } : { done: done, value: self[i++] }; + } + }; + iterator[Si] = returnThis; + return iterator; }; - iterator[Si] = returnThis; - return iterator; - }; - if (!SP[Si]) SP[Si] = function () { - var fromCodePoint = String.fromCodePoint, - self = this, - i = 0, - length = self.length, - iterator = { - next: function next() { - var done = length <= i, - c = done ? '' : fromCodePoint(self.codePointAt(i)); - i += c.length; - return done ? { done: done } : { done: done, value: c }; - } + if (!SP[Si]) SP[Si] = function () { + var fromCodePoint = String.fromCodePoint, + self = this, + i = 0, + length = self.length, + iterator = { + next: function next() { + var done = length <= i, + c = done ? '' : fromCodePoint(self.codePointAt(i)); + i += c.length; + return done ? { done: done } : { done: done, value: c }; + } + }; + iterator[Si] = returnThis; + return iterator; }; - iterator[Si] = returnThis; - return iterator; + })(Symbol.iterator, Array.prototype, String.prototype); + } + + if (typeof FEATURE_NO_ES2015 === 'undefined') { + + Number.isNaN = Number.isNaN || function (value) { + return value !== value; }; - })(Symbol.iterator, Array.prototype, String.prototype); - Number.isNaN = Number.isNaN || function (value) { - return value !== value; - }; + Number.isFinite = Number.isFinite || function (value) { + return typeof value === "number" && isFinite(value); + }; + } - Number.isFinite = Number.isFinite || function (value) { - return typeof value === "number" && isFinite(value); - }; if (!String.prototype.endsWith || function () { try { return !"ab".endsWith("a", 1); @@ -308,109 +315,112 @@ System.register(['aurelia-pal'], function (_export, _context) { }; } - if (!Array.from) { - Array.from = function () { - var toInteger = function toInteger(it) { - return isNaN(it = +it) ? 0 : (it > 0 ? Math.floor : Math.ceil)(it); - }; - var toLength = function toLength(it) { - return it > 0 ? Math.min(toInteger(it), 0x1fffffffffffff) : 0; - }; - var iterCall = function iterCall(iter, fn, val, index) { - try { - return fn(val, index); - } catch (E) { - if (typeof iter.return == 'function') iter.return(); - throw E; - } - }; + if (typeof FEATURE_NO_ES2015 === 'undefined') { - return function from(arrayLike) { - var O = Object(arrayLike), - C = typeof this == 'function' ? this : Array, - aLen = arguments.length, - mapfn = aLen > 1 ? arguments[1] : undefined, - mapping = mapfn !== undefined, - index = 0, - iterFn = O[Symbol.iterator], - length, - result, - step, - iterator; - if (mapping) mapfn = mapfn.bind(aLen > 2 ? arguments[2] : undefined); - if (iterFn != undefined && !Array.isArray(arrayLike)) { - for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { - result[index] = mapping ? iterCall(iterator, mapfn, step.value, index) : step.value; + if (!Array.from) { + Array.from = function () { + var toInteger = function toInteger(it) { + return isNaN(it = +it) ? 0 : (it > 0 ? Math.floor : Math.ceil)(it); + }; + var toLength = function toLength(it) { + return it > 0 ? Math.min(toInteger(it), 0x1fffffffffffff) : 0; + }; + var iterCall = function iterCall(iter, fn, val, index) { + try { + return fn(val, index); + } catch (E) { + if (typeof iter.return == 'function') iter.return(); + throw E; } - } else { - length = toLength(O.length); - for (result = new C(length); length > index; index++) { - result[index] = mapping ? mapfn(O[index], index) : O[index]; + }; + + return function from(arrayLike) { + var O = Object(arrayLike), + C = typeof this == 'function' ? this : Array, + aLen = arguments.length, + mapfn = aLen > 1 ? arguments[1] : undefined, + mapping = mapfn !== undefined, + index = 0, + iterFn = O[Symbol.iterator], + length, + result, + step, + iterator; + if (mapping) mapfn = mapfn.bind(aLen > 2 ? arguments[2] : undefined); + if (iterFn != undefined && !Array.isArray(arrayLike)) { + for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { + result[index] = mapping ? iterCall(iterator, mapfn, step.value, index) : step.value; + } + } else { + length = toLength(O.length); + for (result = new C(length); length > index; index++) { + result[index] = mapping ? mapfn(O[index], index) : O[index]; + } } - } - result.length = index; - return result; - }; - }(); - } + result.length = index; + return result; + }; + }(); + } - if (!Array.prototype.find) { - Object.defineProperty(Array.prototype, 'find', { - configurable: true, - writable: true, - enumerable: false, - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.find called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return value; + if (!Array.prototype.find) { + Object.defineProperty(Array.prototype, 'find', { + configurable: true, + writable: true, + enumerable: false, + value: function value(predicate) { + if (this === null) { + throw new TypeError('Array.prototype.find called on null or undefined'); + } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return value; + } } + return undefined; } - return undefined; - } - }); - } + }); + } - if (!Array.prototype.findIndex) { - Object.defineProperty(Array.prototype, 'findIndex', { - configurable: true, - writable: true, - enumerable: false, - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.findIndex called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return i; + if (!Array.prototype.findIndex) { + Object.defineProperty(Array.prototype, 'findIndex', { + configurable: true, + writable: true, + enumerable: false, + value: function value(predicate) { + if (this === null) { + throw new TypeError('Array.prototype.findIndex called on null or undefined'); + } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return i; + } } + return -1; } - return -1; - } - }); + }); + } } - if (!Array.prototype.includes) { + if (typeof FEATURE_NO_ES2016 === 'undefined' && !Array.prototype.includes) { Object.defineProperty(Array.prototype, 'includes', { configurable: true, writable: true, @@ -444,378 +454,394 @@ System.register(['aurelia-pal'], function (_export, _context) { }); } - (function () { - var needsFix = false; + if (typeof FEATURE_NO_ES2015 === 'undefined') { - try { - var s = Object.keys('a'); - needsFix = s.length !== 1 || s[0] !== '0'; - } catch (e) { - needsFix = true; - } + (function () { + var needsFix = false; - if (needsFix) { - Object.keys = function () { - var hasOwnProperty = Object.prototype.hasOwnProperty, - hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'), - dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], - dontEnumsLength = dontEnums.length; + try { + var s = Object.keys('a'); + needsFix = s.length !== 1 || s[0] !== '0'; + } catch (e) { + needsFix = true; + } - return function (obj) { - if (obj === undefined || obj === null) { - throw TypeError('Cannot convert undefined or null to object'); - } + if (needsFix) { + Object.keys = function () { + var hasOwnProperty = Object.prototype.hasOwnProperty, + hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'), + dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], + dontEnumsLength = dontEnums.length; - obj = Object(obj); + return function (obj) { + if (obj === undefined || obj === null) { + throw TypeError('Cannot convert undefined or null to object'); + } + + obj = Object(obj); - var result = [], - prop, - i; + var result = [], + prop, + i; - for (prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - result.push(prop); + for (prop in obj) { + if (hasOwnProperty.call(obj, prop)) { + result.push(prop); + } } - } - if (hasDontEnumBug) { - for (i = 0; i < dontEnumsLength; i++) { - if (hasOwnProperty.call(obj, dontEnums[i])) { - result.push(dontEnums[i]); + if (hasDontEnumBug) { + for (i = 0; i < dontEnumsLength; i++) { + if (hasOwnProperty.call(obj, dontEnums[i])) { + result.push(dontEnums[i]); + } } } - } - return result; - }; - }(); - } - })(); + return result; + }; + }(); + } + })(); - (function (O) { - if ('assign' in O) { - return; - } + (function (O) { + if ('assign' in O) { + return; + } - O.defineProperty(O, 'assign', { - configurable: true, - writable: true, - value: function () { - var gOPS = O.getOwnPropertySymbols, - pIE = O.propertyIsEnumerable, - filterOS = gOPS ? function (self) { - return gOPS(self).filter(pIE, self); - } : function () { - return Array.prototype; - }; + O.defineProperty(O, 'assign', { + configurable: true, + writable: true, + value: function () { + var gOPS = O.getOwnPropertySymbols, + pIE = O.propertyIsEnumerable, + filterOS = gOPS ? function (self) { + return gOPS(self).filter(pIE, self); + } : function () { + return Array.prototype; + }; + + return function assign(where) { + if (gOPS && !(where instanceof O)) { + console.warn('problematic Symbols', where); + } - return function assign(where) { - if (gOPS && !(where instanceof O)) { - console.warn('problematic Symbols', where); - } + function set(keyOrSymbol) { + where[keyOrSymbol] = arg[keyOrSymbol]; + } - function set(keyOrSymbol) { - where[keyOrSymbol] = arg[keyOrSymbol]; - } + for (var i = 1, ii = arguments.length; i < ii; ++i) { + var arg = arguments[i]; - for (var i = 1, ii = arguments.length; i < ii; ++i) { - var arg = arguments[i]; + if (arg === null || arg === undefined) { + continue; + } - if (arg === null || arg === undefined) { - continue; + O.keys(arg).concat(filterOS(arg)).forEach(set); } - O.keys(arg).concat(filterOS(arg)).forEach(set); - } - - return where; - }; - }() - }); - })(Object); + return where; + }; + }() + }); + })(Object); + } - (function (global) { - var i; + if (typeof FEATURE_NO_ES2015 === 'undefined') { - var defineProperty = Object.defineProperty, - is = function is(a, b) { - return a === b || a !== a && b !== b; - }; + (function (global) { + var i; - if (typeof WeakMap == 'undefined') { - global.WeakMap = createCollection({ - 'delete': sharedDelete, + var defineProperty = Object.defineProperty, + is = function is(a, b) { + return a === b || a !== a && b !== b; + }; - clear: sharedClear, + if (typeof WeakMap == 'undefined') { + global.WeakMap = createCollection({ + 'delete': sharedDelete, - get: sharedGet, + clear: sharedClear, - has: mapHas, + get: sharedGet, - set: sharedSet - }, true); - } + has: mapHas, - if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) { - var _createCollection; - - global.Map = createCollection((_createCollection = { - 'delete': sharedDelete, + set: sharedSet + }, true); + } - has: mapHas, + if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) { + var _createCollection; - get: sharedGet, + global.Map = createCollection((_createCollection = { + 'delete': sharedDelete, - set: sharedSet, + has: mapHas, - keys: sharedKeys, + get: sharedGet, - values: sharedValues, + set: sharedSet, - entries: mapEntries, + keys: sharedKeys, - forEach: sharedForEach, + values: sharedValues, - clear: sharedClear - }, _createCollection[Symbol.iterator] = mapEntries, _createCollection)); - } + entries: mapEntries, - if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) { - var _createCollection2; + forEach: sharedForEach, - global.Set = createCollection((_createCollection2 = { - has: setHas, + clear: sharedClear + }, _createCollection[Symbol.iterator] = mapEntries, _createCollection)); + } - add: sharedAdd, + if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) { + var _createCollection2; - 'delete': sharedDelete, + global.Set = createCollection((_createCollection2 = { + has: setHas, - clear: sharedClear, + add: sharedAdd, - keys: sharedValues, - values: sharedValues, + 'delete': sharedDelete, - entries: setEntries, + clear: sharedClear, - forEach: sharedForEach - }, _createCollection2[Symbol.iterator] = sharedValues, _createCollection2)); - } + keys: sharedValues, + values: sharedValues, - if (typeof WeakSet == 'undefined') { - global.WeakSet = createCollection({ - 'delete': sharedDelete, + entries: setEntries, - add: sharedAdd, + forEach: sharedForEach + }, _createCollection2[Symbol.iterator] = sharedValues, _createCollection2)); + } - clear: sharedClear, + if (typeof WeakSet == 'undefined') { + global.WeakSet = createCollection({ + 'delete': sharedDelete, - has: setHas - }, true); - } + add: sharedAdd, - function createCollection(proto, objectOnly) { - function Collection(a) { - if (!this || this.constructor !== Collection) return new Collection(a); - this._keys = []; - this._values = []; - this._itp = []; - this.objectOnly = objectOnly; + clear: sharedClear, - if (a) init.call(this, a); + has: setHas + }, true); } - if (!objectOnly) { - defineProperty(proto, 'size', { - get: sharedSize - }); - } + function createCollection(proto, objectOnly) { + function Collection(a) { + if (!this || this.constructor !== Collection) return new Collection(a); + this._keys = []; + this._values = []; + this._itp = []; + this.objectOnly = objectOnly; - proto.constructor = Collection; - Collection.prototype = proto; + if (a) init.call(this, a); + } - return Collection; - } + if (!objectOnly) { + defineProperty(proto, 'size', { + get: sharedSize + }); + } - function init(a) { - var i; + proto.constructor = Collection; + Collection.prototype = proto; - if (this.add) a.forEach(this.add, this);else a.forEach(function (a) { - this.set(a[0], a[1]); - }, this); - } + return Collection; + } - function sharedDelete(key) { - if (this.has(key)) { - this._keys.splice(i, 1); - this._values.splice(i, 1); + function init(a) { + var i; - this._itp.forEach(function (p) { - if (i < p[0]) p[0]--; - }); + if (this.add) a.forEach(this.add, this);else a.forEach(function (a) { + this.set(a[0], a[1]); + }, this); } - return -1 < i; - }; + function sharedDelete(key) { + if (this.has(key)) { + this._keys.splice(i, 1); + this._values.splice(i, 1); - function sharedGet(key) { - return this.has(key) ? this._values[i] : undefined; - } + this._itp.forEach(function (p) { + if (i < p[0]) p[0]--; + }); + } - function has(list, key) { - if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key"); + return -1 < i; + }; - if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key); - return -1 < i; - } + function sharedGet(key) { + return this.has(key) ? this._values[i] : undefined; + } - function setHas(value) { - return has.call(this, this._values, value); - } + function has(list, key) { + if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key"); - function mapHas(value) { - return has.call(this, this._keys, value); - } + if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key); + return -1 < i; + } - function sharedSet(key, value) { - this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; - return this; - } + function setHas(value) { + return has.call(this, this._values, value); + } - function sharedAdd(value) { - if (!this.has(value)) this._values.push(value); - return this; - } + function mapHas(value) { + return has.call(this, this._keys, value); + } - function sharedClear() { - (this._keys || 0).length = this._values.length = 0; - } + function sharedSet(key, value) { + this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; + return this; + } - function sharedKeys() { - return sharedIterator(this._itp, this._keys); - } + function sharedAdd(value) { + if (!this.has(value)) this._values.push(value); + return this; + } - function sharedValues() { - return sharedIterator(this._itp, this._values); - } + function sharedClear() { + (this._keys || 0).length = this._values.length = 0; + } - function mapEntries() { - return sharedIterator(this._itp, this._keys, this._values); - } + function sharedKeys() { + return sharedIterator(this._itp, this._keys); + } - function setEntries() { - return sharedIterator(this._itp, this._values, this._values); - } + function sharedValues() { + return sharedIterator(this._itp, this._values); + } - function sharedIterator(itp, array, array2) { - var _ref; + function mapEntries() { + return sharedIterator(this._itp, this._keys, this._values); + } - var p = [0], - done = false; - itp.push(p); - return _ref = {}, _ref[Symbol.iterator] = function () { - return this; - }, _ref.next = function next() { - var v, - k = p[0]; - if (!done && k < array.length) { - v = array2 ? [array[k], array2[k]] : array[k]; - p[0]++; - } else { - done = true; - itp.splice(itp.indexOf(p), 1); - } - return { done: done, value: v }; - }, _ref; - } + function setEntries() { + return sharedIterator(this._itp, this._values, this._values); + } - function sharedSize() { - return this._values.length; - } + function sharedIterator(itp, array, array2) { + var _ref; + + var p = [0], + done = false; + itp.push(p); + return _ref = {}, _ref[Symbol.iterator] = function () { + return this; + }, _ref.next = function next() { + var v, + k = p[0]; + if (!done && k < array.length) { + v = array2 ? [array[k], array2[k]] : array[k]; + p[0]++; + } else { + done = true; + itp.splice(itp.indexOf(p), 1); + } + return { done: done, value: v }; + }, _ref; + } - function sharedForEach(callback, context) { - var it = this.entries(); - for (;;) { - var r = it.next(); - if (r.done) break; - callback.call(context, r.value[1], r.value[0], this); + function sharedSize() { + return this._values.length; } - } - })(PLATFORM.global); - emptyMetadata = Object.freeze({}); - metadataContainerKey = '__metadata__'; - bind = Function.prototype.bind; + function sharedForEach(callback, context) { + var it = this.entries(); + for (;;) { + var r = it.next(); + if (r.done) break; + callback.call(context, r.value[1], r.value[0], this); + } + } + })(PLATFORM.global); + } + if (typeof FEATURE_NO_ES2015 === 'undefined') { + (function () { - if (typeof PLATFORM.global.Reflect === 'undefined') { - PLATFORM.global.Reflect = {}; - } + var bind = Function.prototype.bind; - if (typeof Reflect.getOwnMetadata !== 'function') { - Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { - if (target.hasOwnProperty(metadataContainerKey)) { - return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; + if (typeof PLATFORM.global.Reflect === 'undefined') { + PLATFORM.global.Reflect = {}; } - }; - } - if (typeof Reflect.defineMetadata !== 'function') { - Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) { - var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {}; - var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); - targetContainer[metadataKey] = metadataValue; - }; - } + if (typeof Reflect.defineProperty !== 'function') { + Reflect.defineProperty = function (target, propertyKey, descriptor) { + if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' ? target === null : typeof target !== 'function') { + throw new TypeError('Reflect.defineProperty called on non-object'); + } + try { + Object.defineProperty(target, propertyKey, descriptor); + return true; + } catch (e) { + return false; + } + }; + } - if (typeof Reflect.metadata !== 'function') { - Reflect.metadata = function (metadataKey, metadataValue) { - return function (target, targetKey) { - Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); - }; - }; - } + if (typeof Reflect.construct !== 'function') { + Reflect.construct = function (Target, args) { + if (args) { + switch (args.length) { + case 0: + return new Target(); + case 1: + return new Target(args[0]); + case 2: + return new Target(args[0], args[1]); + case 3: + return new Target(args[0], args[1], args[2]); + case 4: + return new Target(args[0], args[1], args[2], args[3]); + } + } - if (typeof Reflect.defineProperty !== 'function') { - Reflect.defineProperty = function (target, propertyKey, descriptor) { - if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' ? target === null : typeof target !== 'function') { - throw new TypeError('Reflect.defineProperty called on non-object'); + var a = [null]; + a.push.apply(a, args); + return new (bind.apply(Target, a))(); + }; } - try { - Object.defineProperty(target, propertyKey, descriptor); - return true; - } catch (e) { - return false; + + if (typeof Reflect.ownKeys !== 'function') { + Reflect.ownKeys = function (o) { + return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o)); + }; } - }; + })(); } - if (typeof Reflect.construct !== 'function') { - Reflect.construct = function (Target, args) { - if (args) { - switch (args.length) { - case 0: - return new Target(); - case 1: - return new Target(args[0]); - case 2: - return new Target(args[0], args[1]); - case 3: - return new Target(args[0], args[1], args[2]); - case 4: - return new Target(args[0], args[1], args[2], args[3]); - } + if (typeof FEATURE_NO_ESNEXT === 'undefined') { + (function () { + + var emptyMetadata = Object.freeze({}); + var metadataContainerKey = '__metadata__'; + + if (typeof Reflect.getOwnMetadata !== 'function') { + Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { + if (target.hasOwnProperty(metadataContainerKey)) { + return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; + } + }; } - var a = [null]; - a.push.apply(a, args); - return new (bind.apply(Target, a))(); - }; - } + if (typeof Reflect.defineMetadata !== 'function') { + Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) { + var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {}; + var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); + targetContainer[metadataKey] = metadataValue; + }; + } - if (typeof Reflect.ownKeys !== 'function') { - Reflect.ownKeys = function (o) { - return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o)); - }; + if (typeof Reflect.metadata !== 'function') { + Reflect.metadata = function (metadataKey, metadataValue) { + return function (target, targetKey) { + Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); + }; + }; + } + })(); } } }; diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 74ef314..496e9a6 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,10 @@ + +# [1.2.0](https://github.com/aurelia/polyfills/compare/1.1.1...v1.2.0) (2017-02-21) + +### Features + +* opt-out for polyfills + ## [1.1.1](https://github.com/aurelia/polyfills/compare/1.1.0...v1.1.1) (2016-09-13) diff --git a/package.json b/package.json index f83306a..cd980b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-polyfills", - "version": "1.1.1", + "version": "1.2.0", "description": "The minimal set of polyfills that the Aurelia platform needs to run on ES5 browsers.", "keywords": [ "aurelia",