From d5d8c0233c3b6cd283df6033b09763c93a58caa2 Mon Sep 17 00:00:00 2001 From: EisenbergEffect Date: Fri, 9 Aug 2019 22:02:34 -0700 Subject: [PATCH] chore(all): prepare release 1.5.2 --- README.md | 4 +- dist/aurelia_no_loader.es5.umd.js | 1506 ++++++++++++++++- dist/aurelia_no_loader.es5.umd.min.js | 2 +- dist/aurelia_no_loader.es5.umd.min.js.map | 2 +- dist/aurelia_router_no_loader.es5.umd.js | 1506 ++++++++++++++++- dist/aurelia_router_no_loader.es5.umd.min.js | 2 +- ...urelia_router_no_loader.es5.umd.min.js.map | 2 +- package-lock.json | 2 +- package.json | 2 +- 9 files changed, 2916 insertions(+), 112 deletions(-) diff --git a/README.md b/README.md index 147d230..1084d66 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ import { BindingEngine, CompositionEngine, ViewCompiler -} from 'https://unpkg.com/aurelia-script@1.4.0/dist/aurelia.esm.min.js'; +} from 'https://unpkg.com/aurelia-script@1.5.2/dist/aurelia.esm.min.js'; ``` ## Online Playground with Single file script @@ -140,4 +140,4 @@ import { * `rollup.config.js` is rollup config for running `npm run bundle` and `npm run build` scripts ### Notes: - `aurelia-script` uses new ECMAScript feature: dynamic import via `import()` API. If your target browser does not support such API, `aurelia-script` won't be able to run. Browser support matrix is at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Browser_compatibility (check for Dynamic import) \ No newline at end of file + `aurelia-script` uses new ECMAScript feature: dynamic import via `import()` API. If your target browser does not support such API, `aurelia-script` won't be able to run. Browser support matrix is at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Browser_compatibility (check for Dynamic import) diff --git a/dist/aurelia_no_loader.es5.umd.js b/dist/aurelia_no_loader.es5.umd.js index cb44dc3..c255763 100644 --- a/dist/aurelia_no_loader.es5.umd.js +++ b/dist/aurelia_no_loader.es5.umd.js @@ -158,6 +158,315 @@ exports.isInitialized = false; } + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + + if (typeof FEATURE_NO_ES2015 === 'undefined') { + (function (Object, GOPS) { + + 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, + 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); + + if (descriptors !== null && (typeof descriptors === 'undefined' ? 'undefined' : _typeof(descriptors)) === 'object') { + 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] && 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 = $defineProperty; + defineProperty(Object, DP, descriptor); + descriptor.value = $getOwnPropertySymbols; + defineProperty(Object, GOPS, descriptor); + var cachedWindowNames = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' ? Object.getOwnPropertyNames(window) : []; + var originalObjectGetOwnPropertyNames = Object.getOwnPropertyNames; + + descriptor.value = function getOwnPropertyNames(o) { + if (toString.call(o) === '[object Window]') { + try { + return originalObjectGetOwnPropertyNames(o); + } catch (e) { + return [].concat([], cachedWindowNames); + } + } + + 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 = propertyIsEnumerable; + defineProperty(ObjectProto, PIE, descriptor); + descriptor.value = _Symbol; + defineProperty(G, 'Symbol', 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 (symbol) { + return hOP.call(source, symbol) ? symbol.slice(prefixLength * 2, -random.length) : void 0; + }; + + defineProperty(_Symbol, 'keyFor', 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 = function (proto, descriptors) { + return arguments.length === 1 ? create(proto) : createWithSymbols(proto, descriptors); + }; + + defineProperty(Object, 'create', descriptor); + + descriptor.value = function () { + var str = toString.call(this); + return str === '[object String]' && onlySymbols(this) ? '[object Symbol]' : str; + }; + + defineProperty(ObjectProto, 'toString', descriptor); + + 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); + + (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; + }; + 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; + }; + })(Symbol.iterator, Array.prototype, String.prototype); + } + + if (typeof FEATURE_NO_ES2015 === 'undefined') { + Number.isNaN = Number.isNaN || function (value) { + return value !== value; + }; + + Number.isFinite = Number.isFinite || function (value) { + return typeof value === "number" && isFinite(value); + }; + } + if (!String.prototype.endsWith || function () { try { return !"ab".endsWith("a", 1); @@ -168,72 +477,894 @@ String.prototype.endsWith = function (searchString, position) { var subjectString = this.toString(); - if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { - position = subjectString.length; + if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { + position = subjectString.length; + } + + position -= searchString.length; + var lastIndex = subjectString.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; + }; + } + + if (!String.prototype.startsWith || function () { + try { + return !"ab".startsWith("b", 1); + } catch (e) { + return true; + } + }()) { + String.prototype.startsWith = function (searchString, position) { + position = position || 0; + return this.substr(position, searchString.length) === searchString; + }; + } + + if (typeof FEATURE_NO_ES2015 === 'undefined') { + 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; + } + }; + + 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; + }; + }(); + } + + 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; + } + }); + } + + 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; + } + }); + } + } + + if (typeof FEATURE_NO_ES2016 === 'undefined' && !Array.prototype.includes) { + Object.defineProperty(Array.prototype, 'includes', { + configurable: true, + writable: true, + enumerable: false, + value: function value(searchElement) { + var O = Object(this); + var len = parseInt(O.length) || 0; + + if (len === 0) { + return false; + } + + var n = parseInt(arguments[1]) || 0; + var k; + + if (n >= 0) { + k = n; + } else { + k = len + n; + + if (k < 0) { + k = 0; + } + } + + var currentElement; + + while (k < len) { + currentElement = O[k]; + + if (searchElement === currentElement || searchElement !== searchElement && currentElement !== currentElement) { + return true; + } + + k++; + } + + return false; + } + }); + } + + if (typeof FEATURE_NO_ES2015 === 'undefined') { + (function () { + var needsFix = false; + + try { + var s = Object.keys('a'); + needsFix = s.length !== 1 || s[0] !== '0'; + } catch (e) { + needsFix = true; + } + + 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); + var result = [], + prop, + i; + + 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]); + } + } + } + + return result; + }; + }(); + } + })(); + + (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; + }; + return function assign(where) { + if (gOPS && !(where instanceof O)) { + console.warn('problematic Symbols', where); + } + + function set(keyOrSymbol) { + where[keyOrSymbol] = arg[keyOrSymbol]; + } + + for (var i = 1, ii = arguments.length; i < ii; ++i) { + var arg = arguments[i]; + + if (arg === null || arg === undefined) { + continue; + } + + O.keys(arg).concat(filterOS(arg)).forEach(set); + } + + return where; + }; + }() + }); + })(Object); + + if (!Object.is) { + Object.is = function (x, y) { + if (x === y) { + return x !== 0 || 1 / x === 1 / y; + } else { + return x !== x && y !== y; + } + }; + } + } + + if (typeof FEATURE_NO_ES2015 === 'undefined') { + (function (global) { + var i; + + var defineProperty = Object.defineProperty, + is = function is(a, b) { + return a === b || a !== a && b !== b; + }; + + if (typeof WeakMap == 'undefined') { + global.WeakMap = createCollection({ + 'delete': sharedDelete, + clear: sharedClear, + get: sharedGet, + has: mapHas, + set: sharedSet + }, true); + } + + if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) { + var _createCollection; + + global.Map = createCollection((_createCollection = { + 'delete': sharedDelete, + has: mapHas, + get: sharedGet, + set: sharedSet, + keys: sharedKeys, + values: sharedValues, + entries: mapEntries, + forEach: sharedForEach, + clear: sharedClear + }, _createCollection[Symbol.iterator] = mapEntries, _createCollection)); + } + + if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) { + var _createCollection2; + + global.Set = createCollection((_createCollection2 = { + has: setHas, + add: sharedAdd, + 'delete': sharedDelete, + clear: sharedClear, + keys: sharedValues, + values: sharedValues, + entries: setEntries, + forEach: sharedForEach + }, _createCollection2[Symbol.iterator] = sharedValues, _createCollection2)); + } + + if (typeof WeakSet == 'undefined') { + global.WeakSet = createCollection({ + 'delete': sharedDelete, + add: sharedAdd, + clear: sharedClear, + 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 + }); + } + + proto.constructor = Collection; + Collection.prototype = proto; + return Collection; + } + + function init(a) { + if (this.add) a.forEach(this.add, this);else a.forEach(function (a) { + this.set(a[0], a[1]); + }, this); + } + + function sharedDelete(key) { + if (this.has(key)) { + this._keys.splice(i, 1); + + this._values.splice(i, 1); + + this._itp.forEach(function (p) { + if (i < p[0]) p[0]--; + }); + } + + return -1 < i; + } + + function sharedGet(key) { + return this.has(key) ? this._values[i] : undefined; + } + + function has(list, key) { + if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key"); + if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key); + return -1 < i; + } + + function setHas(value) { + return has.call(this, this._values, value); + } + + function mapHas(value) { + return has.call(this, this._keys, value); + } + + function sharedSet(key, value) { + this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; + return this; + } + + function sharedAdd(value) { + if (!this.has(value)) this._values.push(value); + return this; + } + + function sharedClear() { + (this._keys || 0).length = this._values.length = 0; + } + + function sharedKeys() { + return sharedIterator(this._itp, this._keys); + } + + function sharedValues() { + return sharedIterator(this._itp, this._values); + } + + function mapEntries() { + return sharedIterator(this._itp, this._keys, this._values); + } + + function setEntries() { + return sharedIterator(this._itp, this._values, this._values); + } + + 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 sharedSize() { + return this._values.length; + } + + 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') { + var bind = Function.prototype.bind; + + if (typeof PLATFORM.global.Reflect === 'undefined') { + PLATFORM.global.Reflect = {}; + } + + 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.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]); + } + } + + var a = [null]; + a.push.apply(a, args); + return new (bind.apply(Target, a))(); + }; + } + + if (typeof Reflect.ownKeys !== 'function') { + Reflect.ownKeys = function (o) { + return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o)); + }; + } + } + + if (typeof FEATURE_NO_ESNEXT === 'undefined') { + 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]; + } + }; + } + + 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.metadata !== 'function') { + Reflect.metadata = function (metadataKey, metadataValue) { + return function (target, targetKey) { + Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); + }; + }; + } + } + + var _PLATFORM = { + location: window.location, + history: window.history, + addEventListener: function addEventListener(eventName, callback, capture) { + this.global.addEventListener(eventName, callback, capture); + }, + removeEventListener: function removeEventListener(eventName, callback, capture) { + this.global.removeEventListener(eventName, callback, capture); + }, + performance: window.performance, + requestAnimationFrame: function requestAnimationFrame(callback) { + return this.global.requestAnimationFrame(callback); + } + }; + + if (typeof FEATURE_NO_IE === 'undefined') { + var test = function test() {}; + + if (test.name === undefined) { + Object.defineProperty(Function.prototype, 'name', { + get: function get() { + var name = this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]; + Object.defineProperty(this, 'name', { + value: name + }); + return name; + } + }); + } + } + + if (typeof FEATURE_NO_IE === 'undefined') { + if (!('classList' in document.createElement('_')) || document.createElementNS && !('classList' in document.createElementNS('http://www.w3.org/2000/svg', 'g'))) { + var protoProp = 'prototype'; + var strTrim = String.prototype.trim; + var arrIndexOf = Array.prototype.indexOf; + var emptyArray = []; + + var DOMEx = function DOMEx(type, message) { + this.name = type; + this.code = DOMException[type]; + this.message = message; + }; + + var checkTokenAndGetIndex = function checkTokenAndGetIndex(classList, token) { + if (token === '') { + throw new DOMEx('SYNTAX_ERR', 'An invalid or illegal string was specified'); + } + + if (/\s/.test(token)) { + throw new DOMEx('INVALID_CHARACTER_ERR', 'String contains an invalid character'); + } + + return arrIndexOf.call(classList, token); + }; + + var ClassList = function ClassList(elem) { + var trimmedClasses = strTrim.call(elem.getAttribute('class') || ''); + var classes = trimmedClasses ? trimmedClasses.split(/\s+/) : emptyArray; + + for (var i = 0, ii = classes.length; i < ii; ++i) { + this.push(classes[i]); + } + + this._updateClassName = function () { + elem.setAttribute('class', this.toString()); + }; + }; + + var classListProto = ClassList[protoProp] = []; + DOMEx[protoProp] = Error[protoProp]; + + classListProto.item = function (i) { + return this[i] || null; + }; + + classListProto.contains = function (token) { + token += ''; + return checkTokenAndGetIndex(this, token) !== -1; + }; + + classListProto.add = function () { + var tokens = arguments; + var i = 0; + var ii = tokens.length; + var token; + var updated = false; + + do { + token = tokens[i] + ''; + + if (checkTokenAndGetIndex(this, token) === -1) { + this.push(token); + updated = true; + } + } while (++i < ii); + + if (updated) { + this._updateClassName(); + } + }; + + classListProto.remove = function () { + var tokens = arguments; + var i = 0; + var ii = tokens.length; + var token; + var updated = false; + var index; + + do { + token = tokens[i] + ''; + index = checkTokenAndGetIndex(this, token); + + while (index !== -1) { + this.splice(index, 1); + updated = true; + index = checkTokenAndGetIndex(this, token); + } + } while (++i < ii); + + if (updated) { + this._updateClassName(); + } + }; + + classListProto.toggle = function (token, force) { + token += ''; + var result = this.contains(token); + var method = result ? force !== true && 'remove' : force !== false && 'add'; + + if (method) { + this[method](token); + } + + if (force === true || force === false) { + return force; + } + + return !result; + }; + + classListProto.toString = function () { + return this.join(' '); + }; + + Object.defineProperty(Element.prototype, 'classList', { + get: function get() { + return new ClassList(this); + }, + enumerable: true, + configurable: true + }); + } else { + var testElement = document.createElement('_'); + testElement.classList.add('c1', 'c2'); + + if (!testElement.classList.contains('c2')) { + var createMethod = function createMethod(method) { + var original = DOMTokenList.prototype[method]; + + DOMTokenList.prototype[method] = function (token) { + for (var i = 0, ii = arguments.length; i < ii; ++i) { + token = arguments[i]; + original.call(this, token); + } + }; + }; + + createMethod('add'); + createMethod('remove'); } - position -= searchString.length; - var lastIndex = subjectString.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; - } + testElement.classList.toggle('c3', false); - if (!String.prototype.startsWith || function () { - try { - return !"ab".startsWith("b", 1); - } catch (e) { - return true; + if (testElement.classList.contains('c3')) { + var _toggle = DOMTokenList.prototype.toggle; + + DOMTokenList.prototype.toggle = function (token, force) { + if (1 in arguments && !this.contains(token) === !force) { + return force; + } + + return _toggle.call(this, token); + }; + } + + testElement = null; } - }()) { - String.prototype.startsWith = function (searchString, position) { - position = position || 0; - return this.substr(position, searchString.length) === searchString; - }; } - { - var emptyMetadata = Object.freeze({}); - var metadataContainerKey = '__metadata__'; + if (typeof FEATURE_NO_IE === 'undefined') { + var _filterEntries = function _filterEntries(key, value) { + var i = 0, + n = _entries.length, + result = []; - if (typeof Reflect.getOwnMetadata !== 'function') { - Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { - if (target.hasOwnProperty(metadataContainerKey)) { - return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; + for (; i < n; i++) { + if (_entries[i][key] == value) { + result.push(_entries[i]); } - }; + } + + return result; + }; + + var _clearEntries = function _clearEntries(type, name) { + var i = _entries.length, + entry; + + while (i--) { + entry = _entries[i]; + + if (entry.entryType == type && (name === void 0 || entry.name == name)) { + _entries.splice(i, 1); + } + } + }; + + // @license http://opensource.org/licenses/MIT + if ('performance' in window === false) { + window.performance = {}; } - 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 ('now' in window.performance === false) { + var nowOffset = Date.now(); + + if (performance.timing && performance.timing.navigationStart) { + nowOffset = performance.timing.navigationStart; + } + + window.performance.now = function now() { + return Date.now() - nowOffset; }; } + var _entries = []; + var _marksIndex = {}; - if (typeof Reflect.metadata !== 'function') { - Reflect.metadata = function (metadataKey, metadataValue) { - return function (target, targetKey) { - Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); + if (!window.performance.mark) { + window.performance.mark = window.performance.webkitMark || function (name) { + var mark = { + name: name, + entryType: "mark", + startTime: window.performance.now(), + duration: 0 }; + + _entries.push(mark); + + _marksIndex[name] = mark; + }; + } + + if (!window.performance.measure) { + window.performance.measure = window.performance.webkitMeasure || function (name, startMark, endMark) { + startMark = _marksIndex[startMark].startTime; + endMark = _marksIndex[endMark].startTime; + + _entries.push({ + name: name, + entryType: "measure", + startTime: startMark, + duration: endMark - startMark + }); }; } + + if (!window.performance.getEntriesByType) { + window.performance.getEntriesByType = window.performance.webkitGetEntriesByType || function (type) { + return _filterEntries("entryType", type); + }; + } + + if (!window.performance.getEntriesByName) { + window.performance.getEntriesByName = window.performance.webkitGetEntriesByName || function (name) { + return _filterEntries("name", name); + }; + } + + if (!window.performance.clearMarks) { + window.performance.clearMarks = window.performance.webkitClearMarks || function (name) { + _clearEntries("mark", name); + }; + } + + if (!window.performance.clearMeasures) { + window.performance.clearMeasures = window.performance.webkitClearMeasures || function (name) { + _clearEntries("measure", name); + }; + } + + _PLATFORM.performance = window.performance; } - var _PLATFORM = { - location: window.location, - history: window.history, - addEventListener: function addEventListener(eventName, callback, capture) { - this.global.addEventListener(eventName, callback, capture); - }, - removeEventListener: function removeEventListener(eventName, callback, capture) { - this.global.removeEventListener(eventName, callback, capture); - }, - performance: window.performance, - requestAnimationFrame: function requestAnimationFrame(callback) { - return this.global.requestAnimationFrame(callback); + if (typeof FEATURE_NO_IE === 'undefined') { + var con = window.console = window.console || {}; + + var nop = function nop() {}; + + if (!con.memory) con.memory = {}; + ('assert,clear,count,debug,dir,dirxml,error,exception,group,' + 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' + 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',').forEach(function (m) { + if (!con[m]) con[m] = nop; + }); + + if (typeof con.log === 'object') { + 'log,info,warn,error,assert,dir,clear,profile,profileEnd'.split(',').forEach(function (method) { + console[method] = this.bind(console[method], console); + }, Function.prototype.call); } - }; + } + + if (typeof FEATURE_NO_IE === 'undefined') { + if (!window.CustomEvent || typeof window.CustomEvent !== 'function') { + var CustomEvent = function CustomEvent(event, params) { + params = params || { + bubbles: false, + cancelable: false, + detail: undefined + }; + var evt = document.createEvent('CustomEvent'); + evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); + return evt; + }; + + CustomEvent.prototype = window.Event.prototype; + window.CustomEvent = CustomEvent; + } + } if (Element && !Element.prototype.matches) { var proto = Element.prototype; @@ -254,6 +1385,61 @@ } }; + if (typeof FEATURE_NO_IE === 'undefined') { + var isSVGTemplate = function isSVGTemplate(el) { + return el.tagName === 'template' && el.namespaceURI === 'http://www.w3.org/2000/svg'; + }; + + var fixSVGTemplateElement = function fixSVGTemplateElement(el) { + var template = el.ownerDocument.createElement('template'); + var attrs = el.attributes; + var length = attrs.length; + var attr; + el.parentNode.insertBefore(template, el); + + while (length-- > 0) { + attr = attrs[length]; + template.setAttribute(attr.name, attr.value); + el.removeAttribute(attr.name); + } + + el.parentNode.removeChild(el); + return fixHTMLTemplateElement(template); + }; + + var fixHTMLTemplateElement = function fixHTMLTemplateElement(template) { + var content = template.content = document.createDocumentFragment(); + var child; + + while (child = template.firstChild) { + content.appendChild(child); + } + + return template; + }; + + var fixHTMLTemplateElementRoot = function fixHTMLTemplateElementRoot(template) { + var content = fixHTMLTemplateElement(template).content; + var childTemplates = content.querySelectorAll('template'); + + for (var i = 0, ii = childTemplates.length; i < ii; ++i) { + var child = childTemplates[i]; + + if (isSVGTemplate(child)) { + fixSVGTemplateElement(child); + } else { + fixHTMLTemplateElement(child); + } + } + + return template; + }; + + if (!_FEATURE.htmlTemplateElement) { + _FEATURE.ensureHTMLTemplateElement = fixHTMLTemplateElementRoot; + } + } + var shadowPoly = window.ShadowDOMPolyfill || null; var _DOM = { Element: Element, @@ -1635,7 +2821,7 @@ }; } - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + var _typeof$1 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; @@ -1740,11 +2926,11 @@ if (traditional) { result.push(encodeKey(key) + '=' + encode(value[i])); } else { - var arrayKey = key + '[' + (_typeof(value[i]) === 'object' && value[i] !== null ? i : '') + ']'; + var arrayKey = key + '[' + (_typeof$1(value[i]) === 'object' && value[i] !== null ? i : '') + ']'; result = result.concat(buildParam(arrayKey, value[i])); } } - } else if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !traditional) { + } else if ((typeof value === 'undefined' ? 'undefined' : _typeof$1(value)) === 'object' && !traditional) { for (var propertyName in value) { result = result.concat(buildParam(key + '[' + propertyName + ']', value[propertyName])); } @@ -1792,7 +2978,7 @@ var key = keys[j] === '' ? currentParams.length : keys[j]; if (j < keysLastIndex) { - var prevValue = !currentParams[key] || _typeof(currentParams[key]) === 'object' ? currentParams[key] : [currentParams[key]]; + var prevValue = !currentParams[key] || _typeof$1(currentParams[key]) === 'object' ? currentParams[key] : [currentParams[key]]; currentParams = currentParams[key] = prevValue || (isNaN(keys[j + 1]) ? {} : []); } else { currentParams = currentParams[key] = value; @@ -3342,7 +4528,7 @@ }; _proto4.toString = function toString() { - return Object.prototype.toString.call(this); + return typeof FEATURE_NO_UNPARSER === 'undefined' ? exports.Unparser.unparse(this) : Object.prototype.toString.call(this); }; return Expression; @@ -4338,6 +5524,222 @@ exports.Unparser = null; + if (typeof FEATURE_NO_UNPARSER === 'undefined') { + exports.Unparser = + /*#__PURE__*/ + function () { + function Unparser(buffer) { + this.buffer = buffer; + } + + Unparser.unparse = function unparse(expression) { + var buffer = []; + var visitor = new exports.Unparser(buffer); + expression.accept(visitor); + return buffer.join(''); + }; + + var _proto23 = Unparser.prototype; + + _proto23.write = function write(text) { + this.buffer.push(text); + }; + + _proto23.writeArgs = function writeArgs(args) { + this.write('('); + + for (var _i17 = 0, length = args.length; _i17 < length; ++_i17) { + if (_i17 !== 0) { + this.write(','); + } + + args[_i17].accept(this); + } + + this.write(')'); + }; + + _proto23.visitBindingBehavior = function visitBindingBehavior(behavior) { + var args = behavior.args; + behavior.expression.accept(this); + this.write("&" + behavior.name); + + for (var _i18 = 0, length = args.length; _i18 < length; ++_i18) { + this.write(':'); + + args[_i18].accept(this); + } + }; + + _proto23.visitValueConverter = function visitValueConverter(converter) { + var args = converter.args; + converter.expression.accept(this); + this.write("|" + converter.name); + + for (var _i19 = 0, length = args.length; _i19 < length; ++_i19) { + this.write(':'); + + args[_i19].accept(this); + } + }; + + _proto23.visitAssign = function visitAssign(assign) { + assign.target.accept(this); + this.write('='); + assign.value.accept(this); + }; + + _proto23.visitConditional = function visitConditional(conditional) { + conditional.condition.accept(this); + this.write('?'); + conditional.yes.accept(this); + this.write(':'); + conditional.no.accept(this); + }; + + _proto23.visitAccessThis = function visitAccessThis(access) { + if (access.ancestor === 0) { + this.write('$this'); + return; + } + + this.write('$parent'); + var i = access.ancestor - 1; + + while (i--) { + this.write('.$parent'); + } + }; + + _proto23.visitAccessScope = function visitAccessScope(access) { + var i = access.ancestor; + + while (i--) { + this.write('$parent.'); + } + + this.write(access.name); + }; + + _proto23.visitAccessMember = function visitAccessMember(access) { + access.object.accept(this); + this.write("." + access.name); + }; + + _proto23.visitAccessKeyed = function visitAccessKeyed(access) { + access.object.accept(this); + this.write('['); + access.key.accept(this); + this.write(']'); + }; + + _proto23.visitCallScope = function visitCallScope(call) { + var i = call.ancestor; + + while (i--) { + this.write('$parent.'); + } + + this.write(call.name); + this.writeArgs(call.args); + }; + + _proto23.visitCallFunction = function visitCallFunction(call) { + call.func.accept(this); + this.writeArgs(call.args); + }; + + _proto23.visitCallMember = function visitCallMember(call) { + call.object.accept(this); + this.write("." + call.name); + this.writeArgs(call.args); + }; + + _proto23.visitPrefix = function visitPrefix(prefix) { + this.write("(" + prefix.operation); + + if (prefix.operation.charCodeAt(0) >= 97) { + this.write(' '); + } + + prefix.expression.accept(this); + this.write(')'); + }; + + _proto23.visitBinary = function visitBinary(binary) { + binary.left.accept(this); + + if (binary.operation.charCodeAt(0) === 105) { + this.write(" " + binary.operation + " "); + } else { + this.write(binary.operation); + } + + binary.right.accept(this); + }; + + _proto23.visitLiteralPrimitive = function visitLiteralPrimitive(literal) { + this.write("" + literal.value); + }; + + _proto23.visitLiteralArray = function visitLiteralArray(literal) { + var elements = literal.elements; + this.write('['); + + for (var _i20 = 0, length = elements.length; _i20 < length; ++_i20) { + if (_i20 !== 0) { + this.write(','); + } + + elements[_i20].accept(this); + } + + this.write(']'); + }; + + _proto23.visitLiteralObject = function visitLiteralObject(literal) { + var keys = literal.keys; + var values = literal.values; + this.write('{'); + + for (var _i21 = 0, length = keys.length; _i21 < length; ++_i21) { + if (_i21 !== 0) { + this.write(','); + } + + this.write("'" + keys[_i21] + "':"); + + values[_i21].accept(this); + } + + this.write('}'); + }; + + _proto23.visitLiteralString = function visitLiteralString(literal) { + var escaped = literal.value.replace(/'/g, "\'"); + this.write("'" + escaped + "'"); + }; + + _proto23.visitLiteralTemplate = function visitLiteralTemplate(literal) { + var cooked = literal.cooked, + expressions = literal.expressions; + var length = expressions.length; + this.write('`'); + this.write(cooked[0]); + + for (var _i22 = 0; _i22 < length; _i22++) { + expressions[_i22].accept(this); + + this.write(cooked[_i22 + 1]); + } + + this.write('`'); + }; + + return Unparser; + }(); + } + var ExpressionCloner = /*#__PURE__*/ function () { diff --git a/dist/aurelia_no_loader.es5.umd.min.js b/dist/aurelia_no_loader.es5.umd.min.js index 3bb4efa..6800e03 100644 --- a/dist/aurelia_no_loader.es5.umd.min.js +++ b/dist/aurelia_no_loader.es5.umd.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).au={})}(this,function(e){"use strict";function t(e,t){for(var n=0;nn.length)&&(t=n.length),t-=e.length;var i=n.indexOf(e,t);return-1!==i&&i===t}),String.prototype.startsWith&&!function(){try{return!"ab".startsWith("b",1)}catch(e){return!0}}()||(String.prototype.startsWith=function(e,t){return t=t||0,this.substr(t,e.length)===e});var d=Object.freeze({});"function"!=typeof Reflect.getOwnMetadata&&(Reflect.getOwnMetadata=function(e,t,n){if(t.hasOwnProperty("__metadata__"))return(t.__metadata__[n]||d)[e]}),"function"!=typeof Reflect.defineMetadata&&(Reflect.defineMetadata=function(e,t,n,i){var r=n.hasOwnProperty("__metadata__")?n.__metadata__:n.__metadata__={};(r[i]||(r[i]={}))[e]=t}),"function"!=typeof Reflect.metadata&&(Reflect.metadata=function(e,t){return function(n,i){Reflect.defineMetadata(e,t,n,i)}});var f={location:window.location,history:window.history,addEventListener:function(e,t,n){this.global.addEventListener(e,t,n)},removeEventListener:function(e,t,n){this.global.removeEventListener(e,t,n)},performance:window.performance,requestAnimationFrame:function(e){return this.global.requestAnimationFrame(e)}};if(Element&&!Element.prototype.matches){var p=Element.prototype;p.matches=p.matchesSelector||p.mozMatchesSelector||p.msMatchesSelector||p.oMatchesSelector||p.webkitMatchesSelector}var v,m={shadowDOM:!!HTMLElement.prototype.attachShadow,scopedCSS:"scoped"in document.createElement("style"),htmlTemplateElement:(v=document.createElement("div"),v.innerHTML="","content"in v.children[0]),mutationObserver:!(!window.MutationObserver&&!window.WebKitMutationObserver),ensureHTMLTemplateElement:function(e){return e}},g=window.ShadowDOMPolyfill||null,b={Element:Element,NodeList:NodeList,SVGElement:SVGElement,boundary:"aurelia-dom-boundary",addEventListener:function(e,t,n){document.addEventListener(e,t,n)},removeEventListener:function(e,t,n){document.removeEventListener(e,t,n)},adoptNode:function(e){return document.adoptNode(e)},createAttribute:function(e){return document.createAttribute(e)},createElement:function(e){return document.createElement(e)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},createDocumentFragment:function(){return document.createDocumentFragment()},createTemplateElement:function(){var e=document.createElement("template");return m.ensureHTMLTemplateElement(e)},createMutationObserver:function(e){return new(window.MutationObserver||window.WebKitMutationObserver)(e)},createCustomEvent:function(e,t){return new window.CustomEvent(e,t)},dispatchEvent:function(e){document.dispatchEvent(e)},getComputedStyle:function(e){return window.getComputedStyle(e)},getElementById:function(e){return document.getElementById(e)},querySelector:function(e){return document.querySelector(e)},querySelectorAll:function(e){return document.querySelectorAll(e)},nextElementSibling:function(e){if(e.nextElementSibling)return e.nextElementSibling;do{e=e.nextSibling}while(e&&1!==e.nodeType);return e},createTemplateFromMarkup:function(e){var t=document.createElement("div");t.innerHTML=e;var n=t.firstElementChild;if(!n||"TEMPLATE"!==n.nodeName)throw new Error("Template markup must be wrapped in a ","content"in H.children[0]),mutationObserver:!(!window.MutationObserver&&!window.WebKitMutationObserver),ensureHTMLTemplateElement:function(e){return e}};if("undefined"==typeof FEATURE_NO_IE){var Q=function(e){var t,n=e.ownerDocument.createElement("template"),i=e.attributes,r=i.length;for(e.parentNode.insertBefore(n,e);r-- >0;)t=i[r],n.setAttribute(t.name,t.value),e.removeAttribute(t.name);return e.parentNode.removeChild(e),W(n)},W=function(e){for(var t,n=e.content=document.createDocumentFragment();t=e.firstChild;)n.appendChild(t);return e};U.htmlTemplateElement||(U.ensureHTMLTemplateElement=function(e){for(var t,n=W(e).content.querySelectorAll("template"),i=0,r=n.length;i element e.g. ");return U.ensureHTMLTemplateElement(n)},appendNode:function(e,t){(t||document.body).appendChild(e)},replaceNode:function(e,t,n){t.parentNode?t.parentNode.replaceChild(e,t):null!==$?$.unwrap(n).replaceChild($.unwrap(e),$.unwrap(t)):n.replaceChild(e,t)},removeNode:function(e,t){e.parentNode?e.parentNode.removeChild(e):t&&(null!==$?$.unwrap(t).removeChild($.unwrap(e)):t.removeChild(e))},injectStyles:function(e,t,n,i){if(i){var r=document.getElementById(i);if(r){if("style"===r.tagName.toLowerCase())return void(r.innerHTML=e);throw new Error("The provided id does not indicate a style tag.")}}var o=document.createElement("style");return o.innerHTML=e,o.type="text/css",i&&(o.id=i),t=t||document.head,n&&t.childNodes.length>0?t.insertBefore(o,t.childNodes[0]):t.appendChild(o),o}};var K={none:0,error:10,warn:20,info:30,debug:40},X={},Y=[],Z=K.none,J=["none","error","warn","info","debug"];function ee(e){return J.filter(function(t){return t===e}).length>0}function te(){return[this].concat(Array.prototype.slice.call(arguments))}function ne(e){var t=K[e];return function(){if(!(this.level0?re():ue.prototype[e]=function(){}},removeCustomLevel:function(e){if(void 0!==K[e]){if(ee(e))throw Error('Built-in log level "'+e+'" cannot be removed.');delete K[e],delete ue.prototype[e]}},setLevel:ae,getLevel:function(){return Z},Logger:ue}),ce=Object.assign||function(e){for(var t=1;t1?t-1:0),i=1;i0?this.dynamicDependencies.map(function(t){return t["protocol:aurelia:resolver"]?t.get(e):e.get(t)}):void 0,n=this.key,i=e.getResolver(n);i&&3===i.strategy&&(n=i.state);var r=e.invoke(n,t);return e.registerInstance(this.asKey,r),r},t.as=function(e){return this.asKey=e,this},e.of=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r0&&e.inject[e.inject.length-1]===Object&&e.inject.pop())};return e?t(e):t}function Ze(){for(var e=arguments.length,t=new Array(e),n=0;n0&&(e.splice(t-1,2),t-=2)}}}(i),i.join("/")}function tt(e,t){if(!e)return t;if(!t)return e;var n=e.match(/^([^\/]*?:)\//),i=n&&n.length>0?n[1]:"",r=void 0;r=0===(e=e.substr(i.length)).indexOf("///")&&"file:"===i?"///":0===e.indexOf("//")?"//":0===e.indexOf("/")?"/":"";for(var o="/"===t.slice(-1)?"/":"",s=e.split("/"),a=t.split("/"),u=[],l=0,c=s.length;l element in "+o+' has no "from" attribute.');r[s]=new at(et(i,o),n.getAttribute("as")),n.parentNode&&n.parentNode.removeChild(n)}}},{key:"factory",get:function(){return this._factory},set:function(e){this._factory=e,this.factoryIsReady=!0}}]),e}(),lt=function(){function e(){this.templateRegistry={}}var t=e.prototype;return t.map=function(e,t){throw new Error("Loaders must implement map(id, source).")},t.normalizeSync=function(e,t){throw new Error("Loaders must implement normalizeSync(moduleId, relativeTo).")},t.normalize=function(e,t){throw new Error("Loaders must implement normalize(moduleId: string, relativeTo: string): Promise.")},t.loadModule=function(e){throw new Error("Loaders must implement loadModule(id).")},t.loadAllModules=function(e){throw new Error("Loader must implement loadAllModules(ids).")},t.loadTemplate=function(e){throw new Error("Loader must implement loadTemplate(url).")},t.loadText=function(e){throw new Error("Loader must implement loadText(url).")},t.applyPluginToUrl=function(e,t){throw new Error("Loader must implement applyPluginToUrl(url, pluginName).")},t.addPlugin=function(e,t){throw new Error("Loader must implement addPlugin(pluginName, implementation).")},t.getOrCreateTemplateRegistryEntry=function(e){return this.templateRegistry[e]||(this.templateRegistry[e]=new ut(e))},e}();function ct(e){return function(){var t=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(t),clearInterval(n),e()}}}var ht,dt,ft,pt,vt,mt,gt,bt,yt,wt,xt,kt,Ct,_t=function(){function e(){var e,t,n,i,r,o=this;this.flushing=!1,this.longStacks=!1,this.microTaskQueue=[],this.microTaskQueueCapacity=1024,this.taskQueue=[],u.mutationObserver?this.requestFlushMicroTaskQueue=(e=function(){return o.flushMicroTaskQueue()},t=c.createMutationObserver(e),n="a",i=c.createTextNode("a"),(r=Object.create(null)).a="b",r.b="a",t.observe(i,{characterData:!0}),function(){i.data=n=r[n]}):this.requestFlushMicroTaskQueue=ct(function(){return o.flushMicroTaskQueue()}),this.requestFlushTaskQueue=ct(function(){return o.flushTaskQueue()})}var t=e.prototype;return t._flushQueue=function(e,t){var n,i=0;try{for(this.flushing=!0;it){for(var r=0,o=e.length-i;rHt)break}Ft.splice(0,n),Ft.length?l.requestAnimationFrame(Wt):(Ut=!1,Qt=0)}function $t(e){if(Qtr;)r++;return!(r>=n.length)&&(i.splice(r,1),n.splice(r,1),!0)}var Yt=[],Zt=[],Jt=[];function en(e,t){var n,i,r,o,s=this._context0,a=this._callable0,u=this._context1,l=this._callable1,c=this._context2,h=this._callable2,d=this._contextsRest?this._contextsRest.length:0;if(d){for(r=Jt.length;r--&&Jt[r];);for(r<0?(r=Jt.length,n=[],i=[],Jt.push(!0),Yt.push(n),Zt.push(i)):(Jt[r]=!0,n=Yt[r],i=Zt[r]),o=d;o--;)n[o]=this._contextsRest[o],i[o]=this._callablesRest[o]}if(s&&(a?a.call(s,e,t):s(e,t)),u&&(l?l.call(u,e,t):u(e,t)),c&&(h?h.call(c,e,t):c(e,t)),d){for(o=0;o0||n>0;)if(0!==t)if(0!==n){var o=e[t-1][n-1],s=e[t-1][n],a=e[t][n-1],u=void 0;(u=s=0){e.splice(h,1),h--,c-=d.addedCount-d.removed.length,u.addedCount+=d.addedCount-f;var p=u.removed.length+d.removed.length-f;if(u.addedCount||p){var v=d.removed;if(u.indexd.index+d.addedCount){var g=u.removed.slice(d.index+d.addedCount-u.index);Array.prototype.push.apply(v,g)}u.removed=v,d.index>>0)continue;var s=sn(o.name);if(s<0)continue;hn(i,s,[o.oldValue],"delete"===o.type?0:1);break;default:console.error("Unexpected record type: "+JSON.stringify(o))}}return i}(0,t).forEach(function(t){1!==t.addedCount||1!==t.removed.length?n=n.concat(cn(e,t.index,t.index+t.addedCount,t.removed,0,t.removed.length)):t.removed[0]!==e[t.index]&&n.push(t)}),n}function fn(e){for(var t,n,i,r,o=new Array(e.size),s=e.keys(),a=0;(t=s.next())&&!t.done;)o[a]=(n="added",i=e,r=t.value,{type:n,object:i,key:r,oldValue:void 0}),a++;return o}var pn=rn()(dt=function(){function e(e,t){this.taskQueue=e,this.queued=!1,this.changeRecords=null,this.oldCollection=null,this.collection=t,this.lengthPropertyName=t instanceof Map||t instanceof Set?"size":"length"}var t=e.prototype;return t.subscribe=function(e,t){this.addSubscriber(e,t)},t.unsubscribe=function(e,t){this.removeSubscriber(e,t)},t.addChangeRecord=function(e){if(this.hasSubscribers()||this.lengthObserver){if("splice"===e.type){var t=e.index,n=e.object.length;t>n?t=n-e.addedCount:t<0&&(t=n+e.removed.length+t-e.addedCount),t<0&&(t=0),e.index=t}null===this.changeRecords?this.changeRecords=[e]:this.changeRecords.push(e),this.queued||(this.queued=!0,this.taskQueue.queueMicroTask(this))}},t.flushChangeRecords=function(){(this.changeRecords&&this.changeRecords.length||this.oldCollection)&&this.call()},t.reset=function(e){this.oldCollection=e,this.hasSubscribers()&&!this.queued&&(this.queued=!0,this.taskQueue.queueMicroTask(this))},t.getLengthObserver=function(){return this.lengthObserver||(this.lengthObserver=new vn(this.collection))},t.call=function(){var e,t=this.changeRecords,n=this.oldCollection;this.queued=!1,this.changeRecords=[],this.oldCollection=null,this.hasSubscribers()&&(e=n?this.collection instanceof Map||this.collection instanceof Set?fn(n):cn(this.collection,0,this.collection.length,n,0,n.length):this.collection instanceof Map||this.collection instanceof Set?t:dn(this.collection,t),this.callSubscribers(e)),this.lengthObserver&&this.lengthObserver.call(this.collection[this.lengthPropertyName])},e}())||dt,vn=rn()(ft=function(){function e(e){this.collection=e,this.lengthPropertyName=e instanceof Map||e instanceof Set?"size":"length",this.currentValue=e[this.lengthPropertyName]}var t=e.prototype;return t.getValue=function(){return this.collection[this.lengthPropertyName]},t.setValue=function(e){this.collection[this.lengthPropertyName]=e},t.subscribe=function(e,t){this.addSubscriber(e,t)},t.unsubscribe=function(e,t){this.removeSubscriber(e,t)},t.call=function(e){var t=this.currentValue;this.callSubscribers(e,t),this.currentValue=e},e}())||ft,mn=Array.prototype,gn=mn.pop,bn=mn.push,yn=mn.reverse,wn=mn.shift,xn=mn.sort,kn=mn.splice,Cn=mn.unshift;function _n(e,t){return En.for(e,t)}mn.__au_patched__?oe("array-observation").warn("Detected 2nd attempt of patching array from Aurelia binding. This is probably caused by dependency mismatch between core modules and a 3rd party plugin. Please see https://github.com/aurelia/cli/pull/906 if you are using webpack."):(Reflect.defineProperty(mn,"__au_patched__",{value:1}),mn.pop=function(){var e=this.length>0,t=gn.apply(this,arguments);return e&&void 0!==this.__array_observer__&&this.__array_observer__.addChangeRecord({type:"delete",object:this,name:this.length,oldValue:t}),t},mn.push=function(){var e=bn.apply(this,arguments);return void 0!==this.__array_observer__&&this.__array_observer__.addChangeRecord({type:"splice",object:this,index:this.length-arguments.length,removed:[],addedCount:arguments.length}),e},mn.reverse=function(){var e;void 0!==this.__array_observer__&&(this.__array_observer__.flushChangeRecords(),e=this.slice());var t=yn.apply(this,arguments);return void 0!==this.__array_observer__&&this.__array_observer__.reset(e),t},mn.shift=function(){var e=this.length>0,t=wn.apply(this,arguments);return e&&void 0!==this.__array_observer__&&this.__array_observer__.addChangeRecord({type:"delete",object:this,name:0,oldValue:t}),t},mn.sort=function(){var e;void 0!==this.__array_observer__&&(this.__array_observer__.flushChangeRecords(),e=this.slice());var t=xn.apply(this,arguments);return void 0!==this.__array_observer__&&this.__array_observer__.reset(e),t},mn.splice=function(){var e=kn.apply(this,arguments);return void 0!==this.__array_observer__&&this.__array_observer__.addChangeRecord({type:"splice",object:this,index:+arguments[0],removed:e,addedCount:arguments.length>2?arguments.length-2:0}),e},mn.unshift=function(){var e=Cn.apply(this,arguments);return void 0!==this.__array_observer__&&this.__array_observer__.addChangeRecord({type:"splice",object:this,index:0,removed:[],addedCount:arguments.length}),e});var En=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.for=function(e,n){return"__array_observer__"in n||Reflect.defineProperty(n,"__array_observer__",{value:t.create(e,n),enumerable:!1,configurable:!1}),n.__array_observer__},t.create=function(e,n){return new t(e,n)},t}(pn),Sn=function(){function t(){this.isAssignable=!1}var n=t.prototype;return n.evaluate=function(e,t,n){throw new Error('Binding expression "'+this+'" cannot be evaluated.')},n.assign=function(e,t,n){throw new Error('Binding expression "'+this+'" cannot be assigned to.')},n.toString=function(){return"undefined"==typeof FEATURE_NO_UNPARSER?e.Unparser.unparse(this):Object.prototype.toString.call(this)},t}(),An=function(e){function t(t,n,i){var r;return(r=e.call(this)||this).expression=t,r.name=n,r.args=i,r}i(t,e);var n=t.prototype;return n.evaluate=function(e,t){return this.expression.evaluate(e,t)},n.assign=function(e,t,n){return this.expression.assign(e,t,n)},n.accept=function(e){return e.visitBindingBehavior(this)},n.connect=function(e,t){this.expression.connect(e,t)},n.bind=function(e,t,n){this.expression.expression&&this.expression.bind&&this.expression.bind(e,t,n);var i=n.bindingBehaviors(this.name);if(!i)throw new Error('No BindingBehavior named "'+this.name+'" was found!');var r="behavior-"+this.name;if(e[r])throw new Error('A binding behavior named "'+this.name+'" has already been applied to "'+this.expression+'"');e[r]=i,i.bind.apply(i,[e,t].concat(Qn(t,this.args,e.lookupFunctions)))},n.unbind=function(e,t){var n="behavior-"+this.name;e[n].unbind(e,t),e[n]=null,this.expression.expression&&this.expression.unbind&&this.expression.unbind(e,t)},t}(Sn),On=function(e){function t(t,n,i){var r;return(r=e.call(this)||this).expression=t,r.name=n,r.args=i,r.allArgs=[t].concat(i),r}i(t,e);var n=t.prototype;return n.evaluate=function(e,t){var n=t.valueConverters(this.name);if(!n)throw new Error('No ValueConverter named "'+this.name+'" was found!');return"toView"in n?n.toView.apply(n,Qn(e,this.allArgs,t)):this.allArgs[0].evaluate(e,t)},n.assign=function(e,t,n){var i=n.valueConverters(this.name);if(!i)throw new Error('No ValueConverter named "'+this.name+'" was found!');return"fromView"in i&&(t=i.fromView.apply(i,[t].concat(Qn(e,this.args,n)))),this.allArgs[0].assign(e,t,n)},n.accept=function(e){return e.visitValueConverter(this)},n.connect=function(e,t){for(var n=this.allArgs,i=n.length;i--;)n[i].connect(e,t);var r=e.lookupFunctions.valueConverters(this.name);if(!r)throw new Error('No ValueConverter named "'+this.name+'" was found!');var o=r.signals;if(void 0!==o)for(i=o.length;i--;)Xo(e,o[i])},t}(Sn),Vn=function(e){function t(t,n){var i;return(i=e.call(this)||this).target=t,i.value=n,i.isAssignable=!0,i}i(t,e);var n=t.prototype;return n.evaluate=function(e,t){return this.target.assign(e,this.value.evaluate(e,t))},n.accept=function(e){e.visitAssign(this)},n.connect=function(e,t){},n.assign=function(e,t){this.value.assign(e,t),this.target.assign(e,t)},t}(Sn),Tn=function(e){function t(t,n,i){var r;return(r=e.call(this)||this).condition=t,r.yes=n,r.no=i,r}i(t,e);var n=t.prototype;return n.evaluate=function(e,t){return this.condition.evaluate(e,t)?this.yes.evaluate(e,t):this.no.evaluate(e,t)},n.accept=function(e){return e.visitConditional(this)},n.connect=function(e,t){this.condition.connect(e,t),this.condition.evaluate(t)?this.yes.connect(e,t):this.no.connect(e,t)},t}(Sn),Nn=function(e){function t(t){var n;return(n=e.call(this)||this).ancestor=t,n}i(t,e);var n=t.prototype;return n.evaluate=function(e,t){for(var n=e.overrideContext,i=this.ancestor;i--&&n;)n=n.parentOverrideContext;return i<1&&n?n.bindingContext:void 0},n.accept=function(e){return e.visitAccessThis(this)},n.connect=function(e,t){},t}(Sn),Rn=function(e){function t(t,n){var i;return(i=e.call(this)||this).name=t,i.ancestor=n,i.isAssignable=!0,i}i(t,e);var n=t.prototype;return n.evaluate=function(e,t){return Tt(this.name,e,this.ancestor)[this.name]},n.assign=function(e,t){var n=Tt(this.name,e,this.ancestor);return n?n[this.name]=t:void 0},n.accept=function(e){return e.visitAccessScope(this)},n.connect=function(e,t){var n=Tt(this.name,t,this.ancestor);e.observeProperty(n,this.name)},t}(Sn),Mn=function(e){function t(t,n){var i;return(i=e.call(this)||this).object=t,i.name=n,i.isAssignable=!0,i}i(t,e);var n=t.prototype;return n.evaluate=function(e,t){var n=this.object.evaluate(e,t);return null==n?n:n[this.name]},n.assign=function(e,t){var n=this.object.evaluate(e);return null==n&&(n={},this.object.assign(e,n)),n[this.name]=t,t},n.accept=function(e){return e.visitAccessMember(this)},n.connect=function(e,t){this.object.connect(e,t);var n=this.object.evaluate(t);n&&e.observeProperty(n,this.name)},t}(Sn),Pn=function(e){function t(t,n){var i;return(i=e.call(this)||this).object=t,i.key=n,i.isAssignable=!0,i}i(t,e);var n=t.prototype;return n.evaluate=function(e,t){return function(e,t){if(Array.isArray(e))return e[parseInt(t,10)];if(e)return e[t];if(null==e)return;return e[t]}(this.object.evaluate(e,t),this.key.evaluate(e,t))},n.assign=function(e,t){return function(e,t,n){if(Array.isArray(e)){var i=parseInt(t,10);e.length<=i&&(e.length=i+1),e[i]=n}else e[t]=n;return n}(this.object.evaluate(e),this.key.evaluate(e),t)},n.accept=function(e){return e.visitAccessKeyed(this)},n.connect=function(e,t){this.object.connect(e,t);var n=this.object.evaluate(t);if(n instanceof Object){this.key.connect(e,t);var i=this.key.evaluate(t);null==i||Array.isArray(n)&&"number"==typeof i||e.observeProperty(n,i)}},t}(Sn),Ln=function(e){function t(t,n,i){var r;return(r=e.call(this)||this).name=t,r.args=n,r.ancestor=i,r}i(t,e);var n=t.prototype;return n.evaluate=function(e,t,n){var i=Qn(e,this.args,t),r=Tt(this.name,e,this.ancestor),o=Wn(r,this.name,n);if(o)return o.apply(r,i)},n.accept=function(e){return e.visitCallScope(this)},n.connect=function(e,t){for(var n=this.args,i=n.length;i--;)n[i].connect(e,t)},t}(Sn),jn=function(e){function t(t,n,i){var r;return(r=e.call(this)||this).object=t,r.name=n,r.args=i,r}i(t,e);var n=t.prototype;return n.evaluate=function(e,t,n){var i=this.object.evaluate(e,t),r=Qn(e,this.args,t),o=Wn(i,this.name,n);if(o)return o.apply(i,r)},n.accept=function(e){return e.visitCallMember(this)},n.connect=function(e,t){if(this.object.connect(e,t),Wn(this.object.evaluate(t),this.name,!1))for(var n=this.args,i=n.length;i--;)n[i].connect(e,t)},t}(Sn),Bn=function(e){function t(t,n){var i;return(i=e.call(this)||this).func=t,i.args=n,i}i(t,e);var n=t.prototype;return n.evaluate=function(e,t,n){var i=this.func.evaluate(e,t);if("function"==typeof i)return i.apply(null,Qn(e,this.args,t));if(n||null!=i)throw new Error(this.func+" is not a function")},n.accept=function(e){return e.visitCallFunction(this)},n.connect=function(e,t){if(this.func.connect(e,t),"function"==typeof this.func.evaluate(t))for(var n=this.args,i=n.length;i--;)n[i].connect(e,t)},t}(Sn),In=function(e){function t(t,n,i){var r;return(r=e.call(this)||this).operation=t,r.left=n,r.right=i,r}i(t,e);var n=t.prototype;return n.evaluate=function(e,t){var n=this.left.evaluate(e,t);switch(this.operation){case"&&":return n&&this.right.evaluate(e,t);case"||":return n||this.right.evaluate(e,t)}var i=this.right.evaluate(e,t);switch(this.operation){case"==":return n==i;case"===":return n===i;case"!=":return n!=i;case"!==":return n!==i;case"instanceof":return"function"==typeof i&&n instanceof i;case"in":return"object"==typeof i&&null!==i&&n in i}if(null===n||null===i||void 0===n||void 0===i){switch(this.operation){case"+":return null!=n?n:null!=i?i:0;case"-":return null!=n?n:null!=i?0-i:0}return null}switch(this.operation){case"+":return function(e,t){if(null!==e&&null!==t)return"string"==typeof e&&"string"!=typeof t?e+t.toString():"string"!=typeof e&&"string"==typeof t?e.toString()+t:e+t;if(null!==e)return e;if(null!==t)return t;return 0}(n,i);case"-":return n-i;case"*":return n*i;case"/":return n/i;case"%":return n%i;case"<":return n":return n>i;case"<=":return n<=i;case">=":return n>=i;case"^":return n^i}throw new Error("Internal error ["+this.operation+"] not handled")},n.accept=function(e){return e.visitBinary(this)},n.connect=function(e,t){this.left.connect(e,t);var n=this.left.evaluate(t);"&&"===this.operation&&!n||"||"===this.operation&&n||this.right.connect(e,t)},t}(Sn),Fn=function(e){function t(t,n){var i;return(i=e.call(this)||this).operation=t,i.expression=n,i}i(t,e);var n=t.prototype;return n.evaluate=function(e,t){switch(this.operation){case"!":return!this.expression.evaluate(e,t);case"typeof":return typeof this.expression.evaluate(e,t);case"void":return void this.expression.evaluate(e,t)}throw new Error("Internal error ["+this.operation+"] not handled")},n.accept=function(e){return e.visitPrefix(this)},n.connect=function(e,t){this.expression.connect(e,t)},t}(Sn),qn=function(e){function t(t){var n;return(n=e.call(this)||this).value=t,n}i(t,e);var n=t.prototype;return n.evaluate=function(e,t){return this.value},n.accept=function(e){return e.visitLiteralPrimitive(this)},n.connect=function(e,t){},t}(Sn),Dn=function(e){function t(t){var n;return(n=e.call(this)||this).value=t,n}i(t,e);var n=t.prototype;return n.evaluate=function(e,t){return this.value},n.accept=function(e){return e.visitLiteralString(this)},n.connect=function(e,t){},t}(Sn),zn=function(e){function t(t,n,i,r){var o;if((o=e.call(this)||this).cooked=t,o.expressions=n||[],o.length=o.expressions.length,o.tagged=void 0!==r,o.tagged)if(o.cooked.raw=i,o.tag=r,r instanceof Rn)o.contextType="Scope";else{if(!(r instanceof Mn||r instanceof Pn))throw new Error(o.tag+" is not a valid template tag");o.contextType="Object"}return o}i(t,e);var n=t.prototype;return n.getScopeContext=function(e,t){return Tt(this.tag.name,e,this.tag.ancestor)},n.getObjectContext=function(e,t){return this.tag.object.evaluate(e,t)},n.evaluate=function(e,t,n){for(var i=new Array(this.length),r=0;r=97&&this.write(" "),e.expression.accept(this),this.write(")")},n.visitBinary=function(e){e.left.accept(this),105===e.operation.charCodeAt(0)?this.write(" "+e.operation+" "):this.write(e.operation),e.right.accept(this)},n.visitLiteralPrimitive=function(e){this.write(""+e.value)},n.visitLiteralArray=function(e){var t=e.elements;this.write("[");for(var n=0,i=t.length;n=this.len?this.err("Unexpected end of expression"):this.err()}if(e&oi)return t;for(var l=this.val;this.tkn&yi;)switch(this.tkn){case Ti:if(this.nextToken(),this.tkn&pi||this.err(),l=this.val,this.nextToken(),e=e&ri|(e&(Jn|ei))<<1|e&ti|(e&ni)>>1|(e&ii)>>2,this.tkn===Oi)continue;t=e&ei?new Rn(l,t.ancestor):new Mn(t,l);continue;case Pi:this.nextToken(),e=ni,t=new Pn(t,this.parseExpression()),this.expect(Li);break;case Oi:this.nextToken();for(var c=[];this.tkn!==Ri&&(c.push(this.parseExpression()),this.opt(Mi)););this.expect(Ri),t=e&ei?new Ln(l,c,t.ancestor):e&(ti|ri)?new jn(t,l,c):new Bn(t,c),e=ii;break;case wi:t=new zn([this.val],[],[this.raw],t),this.nextToken();break;case xi:t=this.parseTemplate(e|si,t)}return t},t.parseTemplate=function(e,t){var n=[this.val],i=e&si?[this.raw]:void 0;this.expect(xi);for(var r=[this.parseExpression()];(this.tkn=this.scanTemplateTail())!==wi;)n.push(this.val),e&si&&i.push(this.raw),this.expect(xi),r.push(this.parseExpression());return n.push(this.val),e&si&&i.push(this.raw),this.nextToken(),new zn(n,r,i,t)},t.nextToken=function(){for(;this.idx=97&&this.ch<=122)return void(this.tkn=this.scanIdentifier());if(null!==(this.tkn=yr[this.ch](this)))return}this.tkn=di},t.next=function(){return this.ch=this.src.charCodeAt(++this.idx)},t.scanIdentifier=function(){for(;gr.has(this.next())||this.ch>127&&br[this.ch];);return ur[this.val=this.raw]||fi},t.scanNumber=function(e){if(e)this.val=0;else for(this.val=this.ch-48;this.next()<=57&&this.ch>=48;)this.val=10*this.val+this.ch-48;if(e||46===this.ch){e||this.next();for(var t=this.idx,n=this.ch-48;this.next()<=57&&this.ch>=48;)n=10*n+this.ch-48;this.val=this.val+n/Math.pow(10,this.idx-t)}if(101===this.ch||69===this.ch){var i=this.idx;for(this.next(),45!==this.ch&&43!==this.ch||this.next(),this.ch>=48&&this.ch<=57||(this.idx=i,this.err("Invalid exponent"));this.next()<=57&&this.ch>=48;);this.val=parseFloat(this.src.slice(this.start,this.idx))}return mi},t.scanString=function(){var e,t=this.ch;this.next();for(var n=this.idx;this.ch!==t;)if(92===this.ch){e||(e=[]),e.push(this.src.slice(n,this.idx)),this.next();var i=void 0;if(117===this.ch)if(this.next(),this.idx+4=this.len?this.err("Unterminated quote"):this.next();var o=this.src.slice(n,this.idx);this.next();var s=o;return null!=e&&(e.push(o),s=e.join("")),this.val=s,gi},t.scanTemplate=function(){for(var e=!0,t="";96!==this.next();)if(36===this.ch){if(this.idx+1=this.len?this.err("Unterminated template literal"):t+=Xn(this.ch);return this.next(),this.val=t,e?wi:xi},t.scanTemplateTail=function(){return this.idx>=this.len&&this.err("Unterminated template"),this.idx--,this.scanTemplate()},t.err=function(e,t){throw void 0===e&&(e="Unexpected token "+this.raw),void 0===t&&(t=this.start),new Error("Parser Error: "+e+" at column "+t+" in expression ["+this.src+"]")},t.opt=function(e){return this.tkn===e&&(this.nextToken(),!0)},t.expect=function(e){this.tkn===e?this.nextToken():this.err("Missing expected token "+lr[e&ui],this.idx)},e}();function Zn(e){switch(e){case 102:return 12;case 110:return 10;case 114:return 13;case 116:return 9;case 118:return 11;default:return e}}var Jn=1024,ei=2048,ti=4096,ni=8192,ii=16384,ri=32768,oi=65536,si=1<<17,ai=511,ui=63,li=448,ci=2048,hi=16384,di=65536|hi|ci,fi=1<<17,pi=32768|fi,vi=1<<18,mi=1<<19|vi,gi=1<<20|vi,bi=1<<21,yi=1<<24,wi=1<<25|yi,xi=1<<26|yi,ki=32768|vi,Ci=32769|vi,_i=32770|vi,Ei=32771|vi,Si=4|pi,Ai=5|pi,Oi=8198|hi|yi,Vi=8199,Ti=8388616|yi,Ni=4105|hi|ci,Ri=4106|hi|ci,Mi=11|hi,Pi=8204|hi|1<<23|yi,Li=4109|ci,ji=14|hi,Bi=15,Ii=18|hi,Fi=19|hi,qi=84|bi,Di=149|bi,zi=214|bi,Hi=279|bi,Ui=280|bi,Qi=281|bi,Wi=282|bi,$i=347|bi,Gi=348|bi,Ki=349|bi,Xi=350|bi,Yi=33119|bi,Zi=33120|bi,Ji=417|bi|1<<22,er=418|bi|1<<22,tr=4227107,nr=4227108,ir=485|bi,rr=486|bi,or=487|bi,sr=40,ar=4194345,ur=Object.create(null);ur.true=Ci,ur.null=_i,ur.false=ki,ur.undefined=Ei,ur.$this=Si,ur.$parent=Ai,ur.in=Yi,ur.instanceof=Zi,ur.typeof=tr,ur.void=nr;var lr=[!1,!0,null,void 0,"$this","$parent","(","{",".","}",")",",","[","]",":","?","'",'"',"&","|","||","&&","^","==","!=","===","!==","<",">","<=",">=","in","instanceof","+","-","typeof","void","*","%","/","=","!"],cr=[36,0,48,58,65,91,95,0,97,123],hr=[36,0,65,91,95,0,97,123,170,0,186,0,192,215,216,247,248,697,736,741,7424,7462,7468,7517,7522,7526,7531,7544,7545,7615,7680,7936,8305,0,8319,0,8336,8349,8490,8492,8498,0,8526,0,8544,8585,11360,11392,42786,42888,42891,42927,42928,42936,42999,43008,43824,43867,43868,43877,64256,64263,65313,65339,65345,65371],dr=[48,58],fr=[0,33,127,161];function pr(e,t,n,i){for(var r=n.length,o=0;o0?a:s+1,e)for(var u=s;u=48?e.scanNumber(!0):Ti},yr[60]=function(e){return 61!==e.next()?$i:(e.next(),Ki)},yr[62]=function(e){return 61!==e.next()?Gi:(e.next(),Xi)},yr[37]=vr(rr),yr[40]=vr(Oi),yr[41]=vr(Ri),yr[42]=vr(ir),yr[43]=vr(Ji),yr[44]=vr(Mi),yr[45]=vr(er),yr[47]=vr(or),yr[58]=vr(ji),yr[63]=vr(Bi),yr[91]=vr(Pi),yr[93]=vr(Li),yr[94]=vr(zi),yr[123]=vr(Vi),yr[125]=vr(Ni);var xr=Map.prototype;function kr(e,t){return Cr.for(e,t)}var Cr=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.for=function(e,n){return"__map_observer__"in n||Reflect.defineProperty(n,"__map_observer__",{value:t.create(e,n),enumerable:!1,configurable:!1}),n.__map_observer__},t.create=function(e,n){var i=new t(e,n),r=xr;return r.set===n.set&&r.delete===n.delete&&r.clear===n.clear||(r={set:n.set,delete:n.delete,clear:n.clear}),n.set=function(){var e=n.has(arguments[0]),t=e?"update":"add",o=n.get(arguments[0]),s=r.set.apply(n,arguments);return e&&o===n.get(arguments[0])||i.addChangeRecord({type:t,object:n,key:arguments[0],oldValue:o}),s},n.delete=function(){var e=n.has(arguments[0]),t=n.get(arguments[0]),o=r.delete.apply(n,arguments);return e&&i.addChangeRecord({type:"delete",object:n,key:arguments[0],oldValue:t}),o},n.clear=function(){var e=r.clear.apply(n,arguments);return i.addChangeRecord({type:"clear",object:n}),e},i},t}(pn);function _r(e){return e.path&&e.path[0]||e.deepPath&&e.deepPath[0]||e.target}function Er(){this.standardStopPropagation(),this.propagationStopped=!0}function Sr(e){e.propagationStopped=!1;for(var t=_r(e),n=[];t;){if(t.capturedCallbacks){var i=t.capturedCallbacks[e.type];i&&(e.stopPropagation!==Er&&(e.standardStopPropagation=e.stopPropagation,e.stopPropagation=Er),n.push(i))}t=t.parentNode}for(var r=n.length-1;r>=0&&!e.propagationStopped;r--){var o=n[r];"handleEvent"in o?o.handleEvent(e):o(e)}}var Ar=function(){function e(e){this.eventName=e,this.count=0}var t=e.prototype;return t.increment=function(){this.count++,1===this.count&&c.addEventListener(this.eventName,Sr,!0)},t.decrement=function(){this.count--,0===this.count&&c.removeEventListener(this.eventName,Sr,!0)},e}();function Or(e){e.propagationStopped=!1;for(var t=_r(e);t&&!e.propagationStopped;){if(t.delegatedCallbacks){var n=t.delegatedCallbacks[e.type];n&&(e.stopPropagation!==Er&&(e.standardStopPropagation=e.stopPropagation,e.stopPropagation=Er),"handleEvent"in n?n.handleEvent(e):n(e))}t=t.parentNode}}var Vr=function(){function e(e){this.eventName=e,this.count=0}var t=e.prototype;return t.increment=function(){this.count++,1===this.count&&c.addEventListener(this.eventName,Or,!1)},t.decrement=function(){this.count--,0===this.count&&c.removeEventListener(this.eventName,Or,!1)},e}(),Tr=function(){function e(e,t,n){this.entry=e,this.lookup=t,this.targetEvent=n}return e.prototype.dispose=function(){this.entry.decrement(),this.lookup[this.targetEvent]=null},e}(),Nr=function(){function e(e,t,n){this.target=e,this.targetEvent=t,this.callback=n}return e.prototype.dispose=function(){this.target.removeEventListener(this.targetEvent,this.callback)},e}(),Rr=function(){function e(){this.delegatedHandlers={},this.capturedHandlers={}}return e.prototype.subscribe=function(e,t,n,i,r){var o,s,a;if(i===Mr.bubbling){o=this.delegatedHandlers,a=o[t]||(o[t]=new Vr(t));var u=e.delegatedCallbacks||(e.delegatedCallbacks={});return a.increment(),u[t]=n,!0===r?new Tr(a,u,t):function(){a.decrement(),u[t]=null}}if(i===Mr.capturing){s=this.capturedHandlers,a=s[t]||(s[t]=new Ar(t));var l=e.capturedCallbacks||(e.capturedCallbacks={});return a.increment(),l[t]=n,!0===r?new Tr(a,l,t):function(){a.decrement(),l[t]=null}}return e.addEventListener(t,n),!0===r?new Nr(e,t,n):function(){e.removeEventListener(t,n)}},e}(),Mr={none:0,capturing:1,bubbling:2},Pr=function(){function e(){this.elementHandlerLookup={},this.eventStrategyLookup={},this.registerElementConfig({tagName:"input",properties:{value:["change","input"],checked:["change","input"],files:["change","input"]}}),this.registerElementConfig({tagName:"textarea",properties:{value:["change","input"]}}),this.registerElementConfig({tagName:"select",properties:{value:["change"]}}),this.registerElementConfig({tagName:"content editable",properties:{value:["change","input","blur","keyup","paste"]}}),this.registerElementConfig({tagName:"scrollable element",properties:{scrollTop:["scroll"],scrollLeft:["scroll"]}}),this.defaultEventStrategy=new Rr}var t=e.prototype;return t.registerElementConfig=function(e){var t,n=e.tagName.toLowerCase(),i=e.properties,r=this.elementHandlerLookup[n]={};for(t in i)i.hasOwnProperty(t)&&(r[t]=i[t])},t.registerEventStrategy=function(e,t){this.eventStrategyLookup[e]=t},t.getElementHandler=function(e,t){var n,i=this.elementHandlerLookup;if(e.tagName){if(i[n=e.tagName.toLowerCase()]&&i[n][t])return new Lr(i[n][t]);if("textContent"===t||"innerHTML"===t)return new Lr(i["content editable"].value);if("scrollTop"===t||"scrollLeft"===t)return new Lr(i["scrollable element"][t])}return null},t.addEventListener=function(e,t,n,i,r){return(this.eventStrategyLookup[t]||this.defaultEventStrategy).subscribe(e,t,n,i,r)},e}(),Lr=function(){function e(e){this.events=e,this.element=null,this.handler=null}var t=e.prototype;return t.subscribe=function(e,t){this.element=e,this.handler=t;for(var n=this.events,i=0,r=n.length;r>i;++i)e.addEventListener(n[i],t)},t.dispose=function(){if(null!==this.element){for(var e=this.element,t=this.handler,n=this.events,i=0,r=n.length;r>i;++i)e.removeEventListener(n[i],t);this.element=this.handler=null}},e}(),jr=function(){function e(){this.tracked=[],this.checkDelay=120}var t=e.prototype;return t.addProperty=function(e){var t=this.tracked;t.push(e),1===t.length&&this.scheduleDirtyCheck()},t.removeProperty=function(e){var t=this.tracked;t.splice(t.indexOf(e),1)},t.scheduleDirtyCheck=function(){var e=this;setTimeout(function(){return e.check()},this.checkDelay)},t.check=function(){for(var e=this.tracked,t=e.length;t--;){var n=e[t];n.isDirty()&&n.call()}e.length&&this.scheduleDirtyCheck()},e}(),Br=rn()(pt=function(){function e(e,t,n){this.dirtyChecker=e,this.obj=t,this.propertyName=n}var t=e.prototype;return t.getValue=function(){return this.obj[this.propertyName]},t.setValue=function(e){this.obj[this.propertyName]=e},t.call=function(){var e=this.oldValue,t=this.getValue();this.callSubscribers(t,e),this.oldValue=t},t.isDirty=function(){return this.oldValue!==this.obj[this.propertyName]},t.subscribe=function(e,t){this.hasSubscribers()||(this.oldValue=this.getValue(),this.dirtyChecker.addProperty(this)),this.addSubscriber(e,t)},t.unsubscribe=function(e,t){this.removeSubscriber(e,t)&&!this.hasSubscribers()&&this.dirtyChecker.removeProperty(this)},e}())||pt,Ir=oe("property-observation"),Fr={getValue:function(e,t){return e[t]},setValue:function(e,t,n){t[n]=e}},qr=function(){function e(e,t){this.doNotCache=!0,this.primitive=e,this.propertyName=t}var t=e.prototype;return t.getValue=function(){return this.primitive[this.propertyName]},t.setValue=function(){var e=typeof this.primitive;throw new Error("The "+this.propertyName+" property of a "+e+" ("+this.primitive+") cannot be assigned.")},t.subscribe=function(){},t.unsubscribe=function(){},e}(),Dr=rn()(vt=function(){function e(e,t,n){this.taskQueue=e,this.obj=t,this.propertyName=n,this.queued=!1,this.observing=!1}var t=e.prototype;return t.getValue=function(){return this.obj[this.propertyName]},t.setValue=function(e){this.obj[this.propertyName]=e},t.getterValue=function(){return this.currentValue},t.setterValue=function(e){var t=this.currentValue;t!==e&&(this.queued||(this.oldValue=t,this.queued=!0,this.taskQueue.queueMicroTask(this)),this.currentValue=e)},t.call=function(){var e=this.oldValue,t=this.currentValue;this.queued=!1,this.callSubscribers(t,e)},t.subscribe=function(e,t){this.observing||this.convertProperty(),this.addSubscriber(e,t)},t.unsubscribe=function(e,t){this.removeSubscriber(e,t)},t.convertProperty=function(){this.observing=!0,this.currentValue=this.obj[this.propertyName],this.setValue=this.setterValue,this.getValue=this.getterValue,Reflect.defineProperty(this.obj,this.propertyName,{configurable:!0,enumerable:!(this.propertyName in this.obj)||this.obj.propertyIsEnumerable(this.propertyName),get:this.getValue.bind(this),set:this.setValue.bind(this)})||Ir.warn("Cannot observe property '"+this.propertyName+"' of object",this.obj)},e}())||vt,zr=function(){function e(e,t,n){this.element=e,this.propertyName=t,this.attributeName=n}var t=e.prototype;return t.getValue=function(){return this.element.getAttributeNS("http://www.w3.org/1999/xlink",this.attributeName)},t.setValue=function(e){return this.element.setAttributeNS("http://www.w3.org/1999/xlink",this.attributeName,e)},t.subscribe=function(){throw new Error('Observation of a "'+this.element.nodeName+'" element\'s "'+this.propertyName+'" property is not supported.')},e}(),Hr={getValue:function(e,t){return e.getAttribute(t)},setValue:function(e,t,n){null==e?t.removeAttribute(n):t.setAttribute(n,e)}},Ur=function(){function e(e,t){this.element=e,this.propertyName=t}var t=e.prototype;return t.getValue=function(){return this.element.getAttribute(this.propertyName)},t.setValue=function(e){return null==e?this.element.removeAttribute(this.propertyName):this.element.setAttribute(this.propertyName,e)},t.subscribe=function(){throw new Error('Observation of a "'+this.element.nodeName+'" element\'s "'+this.propertyName+'" property is not supported.')},e}(),Qr=function(){function e(e,t){this.element=e,this.propertyName=t,this.styles=null,this.version=0}var t=e.prototype;return t.getValue=function(){return this.element.style.cssText},t._setProperty=function(e,t){var n="";null!=t&&"function"==typeof t.indexOf&&-1!==t.indexOf("!important")&&(n="important",t=t.replace("!important","")),this.element.style.setProperty(e,t,n)},t.setValue=function(e){var t,n,i=this.styles||{},r=this.version;if(null!=e)if(e instanceof Object)for(t in e)e.hasOwnProperty(t)&&(n=e[t],i[t=t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})]=r,this._setProperty(t,n));else if(e.length)for(var o,s=/\s*([\w\-]+)\s*:\s*((?:(?:[\w\-]+\(\s*(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[\w\-]+\(\s*(?:^"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^\)]*)\),?|[^\)]*)\),?|"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^;]*),?\s*)+);?/g;null!==(o=s.exec(e));)(t=o[1])&&(i[t]=r,this._setProperty(t,o[2]));if(this.styles=i,this.version+=1,0!==r)for(t in r-=1,i)i.hasOwnProperty(t)&&i[t]===r&&this.element.style.removeProperty(t)},t.subscribe=function(){throw new Error('Observation of a "'+this.element.nodeName+'" element\'s "'+this.propertyName+'" property is not supported.')},e}(),Wr=rn()(mt=function(){function e(e,t,n){this.element=e,this.propertyName=t,this.handler=n,"files"===t&&(this.setValue=function(){})}var t=e.prototype;return t.getValue=function(){return this.element[this.propertyName]},t.setValue=function(e){e=null==e?"":e,this.element[this.propertyName]!==e&&(this.element[this.propertyName]=e,this.notify())},t.notify=function(){var e=this.oldValue,t=this.getValue();this.callSubscribers(t,e),this.oldValue=t},t.handleEvent=function(){this.notify()},t.subscribe=function(e,t){this.hasSubscribers()||(this.oldValue=this.getValue(),this.handler.subscribe(this.element,this)),this.addSubscriber(e,t)},t.unsubscribe=function(e,t){this.removeSubscriber(e,t)&&!this.hasSubscribers()&&this.handler.dispose()},e}())||mt,$r=rn()(gt=function(){function e(e,t,n){this.element=e,this.handler=t,this.observerLocator=n}var t=e.prototype;return t.getValue=function(){return this.value},t.setValue=function(e){this.initialSync&&this.value===e||(this.arrayObserver&&(this.arrayObserver.unsubscribe("CheckedObserver:array",this),this.arrayObserver=null),"checkbox"===this.element.type&&Array.isArray(e)&&(this.arrayObserver=this.observerLocator.getArrayObserver(e),this.arrayObserver.subscribe("CheckedObserver:array",this)),this.oldValue=this.value,this.value=e,this.synchronizeElement(),this.notify(),this.initialSync||(this.initialSync=!0,this.observerLocator.taskQueue.queueMicroTask(this)))},t.call=function(e,t){this.synchronizeElement(),this.valueObserver||(this.valueObserver=this.element.__observers__.model||this.element.__observers__.value,this.valueObserver&&this.valueObserver.subscribe("CheckedObserver:value",this))},t.synchronizeElement=function(){var e=this.value,t=this.element,n=t.hasOwnProperty("model")?t.model:t.value,i="radio"===t.type,r=t.matcher||function(e,t){return e===t};t.checked=i&&!!r(e,n)||!i&&!0===e||!i&&Array.isArray(e)&&-1!==e.findIndex(function(e){return!!r(e,n)})},t.synchronizeValue=function(){var e,t=this.value,n=this.element,i=n.hasOwnProperty("model")?n.model:n.value,r=n.matcher||function(e,t){return e===t};if("checkbox"===n.type){if(Array.isArray(t))return e=t.findIndex(function(e){return!!r(e,i)}),void(n.checked&&-1===e?t.push(i):n.checked||-1===e||t.splice(e,1));t=n.checked}else{if(!n.checked)return;t=i}this.oldValue=this.value,this.value=t,this.notify()},t.notify=function(){var e=this.oldValue,t=this.value;t!==e&&this.callSubscribers(t,e)},t.handleEvent=function(){this.synchronizeValue()},t.subscribe=function(e,t){this.hasSubscribers()||this.handler.subscribe(this.element,this),this.addSubscriber(e,t)},t.unsubscribe=function(e,t){this.removeSubscriber(e,t)&&!this.hasSubscribers()&&this.handler.dispose()},t.unbind=function(){this.arrayObserver&&(this.arrayObserver.unsubscribe("CheckedObserver:array",this),this.arrayObserver=null),this.valueObserver&&this.valueObserver.unsubscribe("CheckedObserver:value",this)},e}())||gt,Gr=rn()(bt=function(){function e(e,t,n){this.element=e,this.handler=t,this.observerLocator=n}var t=e.prototype;return t.getValue=function(){return this.value},t.setValue=function(e){if(null!=e&&this.element.multiple&&!Array.isArray(e))throw new Error("Only null or Array instances can be bound to a multi-select.");this.value!==e&&(this.arrayObserver&&(this.arrayObserver.unsubscribe("SelectValueObserver:array",this),this.arrayObserver=null),Array.isArray(e)&&(this.arrayObserver=this.observerLocator.getArrayObserver(e),this.arrayObserver.subscribe("SelectValueObserver:array",this)),this.oldValue=this.value,this.value=e,this.synchronizeOptions(),this.notify(),this.initialSync||(this.initialSync=!0,this.observerLocator.taskQueue.queueMicroTask(this)))},t.call=function(e,t){this.synchronizeOptions()},t.synchronizeOptions=function(){var e,t=this.value;Array.isArray(t)&&(e=!0);for(var n=this.element.options,i=n.length,r=this.element.matcher||function(e,t){return e===t},o=function(){var o=n.item(i),s=o.hasOwnProperty("model")?o.model:o.value;if(e)return o.selected=-1!==t.findIndex(function(e){return!!r(s,e)}),"continue";o.selected=!!r(s,t)};i--;)o()},t.synchronizeValue=function(){for(var e=this,t=this.element.options,n=0,i=[],r=0,o=t.length;r").firstElementChild.nodeName&&ro.altGlyph&&(ro.altglyph=ro.altGlyph,delete ro.altGlyph,ro.altglyphdef=ro.altGlyphDef,delete ro.altGlyphDef,ro.altglyphitem=ro.altGlyphItem,delete ro.altGlyphItem,ro.glyphref=ro.glyphRef,delete ro.glyphRef)}return e.prototype.isStandardSvgAttribute=function(e,t){return oo[e]&&so[t]||ro[e]&&-1!==ro[e].indexOf(t)},e}()}var ro=Yr,oo=Zr,so=Jr,ao=eo||function(){function e(){}return e.prototype.isStandardSvgAttribute=function(){return!1},e}(),uo=(wt=yt=function(){function e(e,t,n,i,r){this.taskQueue=e,this.eventManager=t,this.dirtyChecker=n,this.svgAnalyzer=i,this.parser=r,this.adapters=[],this.logger=oe("observer-locator")}var t=e.prototype;return t.getObserver=function(e,t){var n,i=e.__observers__;return i&&t in i?i[t]:((n=this.createPropertyObserver(e,t)).doNotCache||(void 0===i&&(i=this.getOrCreateObserversLookup(e)),i[t]=n),n)},t.getOrCreateObserversLookup=function(e){return e.__observers__||this.createObserversLookup(e)},t.createObserversLookup=function(e){var t={};return Reflect.defineProperty(e,"__observers__",{enumerable:!1,configurable:!1,writable:!1,value:t})||this.logger.warn("Cannot add observers to object",e),t},t.addAdapter=function(e){this.adapters.push(e)},t.getAdapterObserver=function(e,t,n){for(var i=0,r=this.adapters.length;i-1&&n.splice(t,1),e},t.publish=function(e,t,n,i){void 0===t&&(t={}),void 0===n&&(n=!0),void 0===i&&(i=!0);var r=c.createCustomEvent(e,{cancelable:i,bubbles:n,detail:t});this.element.dispatchEvent(r)},t.subscribe=function(e,t,n){if(void 0===n&&(n=!0),"function"==typeof t)return new as(this,e,t,n,!1)},t.subscribeOnce=function(e,t,n){if(void 0===n&&(n=!0),"function"==typeof t)return new as(this,e,t,n,!0)},t.dispose=function(e){if(e&&"string"==typeof e){var t=this.subscriptions[e];if(t)for(;t.length;){var n=t.pop();n&&n.dispose()}}else this.disposeAll()},t.disposeAll=function(){for(var e in this.subscriptions)this.dispose(e)},e}(),as=function(){function e(e,t,n,i,r){this.owner=e,this.eventName=t,this.handler=n,this.capture="boolean"==typeof i?i:i.capture,this.bubbles=!this.capture,this.captureOrOptions=i,this.once=r,e.element.addEventListener(t,this,i),e._enqueueHandler(this)}var t=e.prototype;return t.handleEvent=function(e){(0,this.handler)(e),this.once&&this.dispose()},t.dispose=function(){this.owner.element.removeEventListener(this.eventName,this,this.captureOrOptions),this.owner._dequeueHandler(this),this.owner=this.handler=null},e}(),us=function(){function e(){this.dependencies={}}var t=e.prototype;return t.addDependency=function(e){this.dependencies[e]=!0},t.hasDependency=function(e){return e in this.dependencies},e}(),ls=function(e,t){void 0===e&&(e=!1),void 0===t&&(t=!1),this.targetShadowDOM=e,this.compileSurrogate=t,this.associatedModuleId=null};ls.normal=new ls;var cs=function(){function e(){}return e.enhance=function(){var t=new e;return t.enhance=!0,t},e.unitTest=function(t,n){var i=new e;return i.type=t,i.attributes=n||{},i},e.element=function(t,n){var i=new e;return i.type=n,i.attributes={},i.anchorIsContainer=!(t.hasAttribute("containerless")||n.containerless),i.initiatedByBehavior=!0,i},e.attribute=function(t,n){var i=new e;return i.attrName=t,i.type=n||null,i.attributes={},i},e.dynamic=function(t,n,i){var r=new e;return r.host=t,r.viewModel=n,r.viewFactory=i,r.inheritBindingContext=!0,r},e}(),hs=cs.prototype;hs.initiatedByBehavior=!1,hs.enhance=!1,hs.partReplacements=null,hs.viewFactory=null,hs.originalAttrName=null,hs.skipContentProcessing=!1,hs.contentFactory=null,hs.viewModel=null,hs.anchorIsContainer=!1,hs.host=null,hs.attributes=null,hs.type=null,hs.attrName=null,hs.inheritBindingContext=!1,cs.normal=new cs;var ds=(To=Vo=function(){function e(){}return e.shadowSlot=function(t){var n=new e;return n.parentInjectorId=t,n.shadowSlot=!0,n},e.contentExpression=function(t){var n=new e;return n.contentExpression=t,n},e.letElement=function(t){var n=new e;return n.expressions=t,n.letElement=!0,n},e.lifting=function(t,n){var i=new e;return i.parentInjectorId=t,i.expressions=e.noExpressions,i.behaviorInstructions=[n],i.viewFactory=n.viewFactory,i.providers=[n.type.target],i.lifting=!0,i},e.normal=function(t,n,i,r,o,s){var a=new e;return a.injectorId=t,a.parentInjectorId=n,a.providers=i,a.behaviorInstructions=r,a.expressions=o,a.anchorIsContainer=!s||s.anchorIsContainer,a.elementInstruction=s,a},e.surrogate=function(t,n,i,r){var o=new e;return o.expressions=i,o.behaviorInstructions=n,o.providers=t,o.values=r,o},e}(),Vo.noExpressions=Object.freeze([]),To),fs=ds.prototype;fs.injectorId=null,fs.parentInjectorId=null,fs.shadowSlot=!1,fs.slotName=null,fs.slotFallbackFactory=null,fs.contentExpression=null,fs.letElement=!1,fs.expressions=null,fs.expressions=null,fs.providers=null,fs.viewFactory=null,fs.anchorIsContainer=!1,fs.elementInstruction=null,fs.lifting=!1,fs.values=null;var ps=Te.create("aurelia:view-strategy",{validate:function(e){return"function"==typeof e.loadViewFactory||"View strategies must implement: loadViewFactory(viewEngine: ViewEngine, compileInstruction: ViewCompileInstruction, loadContext?: ResourceLoadContext): Promise"},compose:function(e){"function"!=typeof e.makeRelativeTo&&(e.makeRelativeTo=l.noop)}}),vs=ps()(No=function(){function e(e){this.path=e,this.absolutePath=null}var t=e.prototype;return t.loadViewFactory=function(e,t,n,i){return null===this.absolutePath&&this.moduleId&&(this.absolutePath=et(this.path,this.moduleId)),t.associatedModuleId=this.moduleId,e.loadViewFactory(this.absolutePath||this.path,t,n,i)},t.makeRelativeTo=function(e){null===this.absolutePath&&(this.absolutePath=et(this.path,e))},e}())||No,ms=ps()(Ro=function(){function e(e,t){this.moduleId=t.moduleId,this.viewUrl=e.convertOriginToViewUrl(t)}return e.prototype.loadViewFactory=function(e,t,n,i){return t.associatedModuleId=this.moduleId,e.loadViewFactory(this.viewUrl,t,n,i)},e}())||Ro,gs=ps()(Mo=function(){function e(e,t){this.dependencies=e||null,this.dependencyBaseUrl=t||""}return e.prototype.loadViewFactory=function(e,t,n,i){var r=this.entry,o=this.dependencies;if(r&&r.factoryIsReady)return Promise.resolve(null);if(this.entry=r=new ut(this.moduleId||this.dependencyBaseUrl),r.dependencies=[],r.templateIsLoaded=!0,null!==o)for(var s=0,a=o.length;s=h.length)break;p=h[f++]}else{if((f=h.next()).done)break;p=f.value}var v=p;if("function"==typeof v)null!==(o=l.autoRegister(s,v)).elementName&&c.push(o);else{if(!v||"object"!=typeof v)throw new Error('dependency neither function nor object. Received: "'+typeof v+'"');for(var m in v){var g=v[m];"function"==typeof g&&null!==(o=l.autoRegister(s,g)).elementName&&c.push(o)}}}return Promise.all(c.map(function(e){return e.load(s,e.target)})).then(function(){var e=null!==r.template?u.compile(r.template,l,t):null;return r.factoryIsReady=!0,r.factory=e,e})})},e}())||jo,xs=(Io=Bo=function(){function e(){}var t=e.prototype;return t.getViewStrategy=function(t){if(!t)return null;if("object"==typeof t&&"getViewStrategy"in t){var n=Ce.get(t.constructor);return"string"==typeof(t=t.getViewStrategy())&&(t=new vs(t)),ps.assert(t),n.moduleId&&t.makeRelativeTo(n.moduleId),t}if("string"==typeof t&&(t=new vs(t)),ps.validate(t))return t;if("function"!=typeof t&&(t=t.constructor),"$view"in t){var i,r=t.$view;return i=null===(r="function"==typeof r?r.call(t):r)?new gs:r instanceof ws?r:new ws(r),we.define(e.viewStrategyMetadataKey,i,t),i}var o=Ce.get(t),s=we.get(e.viewStrategyMetadataKey,t);if(s)o.moduleId&&(s.moduleId=o.moduleId);else{if(!o.moduleId)throw new Error("Cannot determine default view strategy for object.",t);s=this.createFallbackViewStrategy(o)}return s},t.createFallbackViewStrategy=function(e){return new ms(this,e)},t.convertOriginToViewUrl=function(e){var t=e.moduleId;return(t.endsWith(".js")||t.endsWith(".ts")?t.substring(0,t.length-3):t)+".html"},e}(),Bo.viewStrategyMetadataKey="aurelia:view-strategy",Io);function ks(e){throw new Error("BindingLanguage must implement "+e+"().")}var Cs=function(){function e(){}var t=e.prototype;return t.inspectAttribute=function(e,t,n,i){ks("inspectAttribute")},t.createAttributeInstruction=function(e,t,n,i){ks("createAttributeInstruction")},t.createLetExpressions=function(e,t){ks("createLetExpressions")},t.inspectTextContent=function(e,t){ks("inspectTextContent")},e}(),_s=Object.freeze([]),Es=function(){function e(e){this.element=e,this.element.auSlotAttribute=this}return e.inject=function(){return[c.Element]},e.prototype.valueChanged=function(e,t){},e}(),Ss=function(){function e(e,t,n,i){this.anchor=e,this.anchor.viewSlot=this,this.name=t,this.destinationName=n,this.fallbackFactory=i,this.destinationSlot=null,this.projections=0,this.contentView=null,new Es(this.anchor).value=this.destinationName}var t=e.prototype;return t.renderFallbackContent=function(e,t,n,i){if(null===this.contentView){this.contentView=this.fallbackFactory.create(this.ownerView.container),this.contentView.bind(this.ownerView.bindingContext,this.ownerView.overrideContext);var r=Object.create(null);r[this.destinationSlot.name]=this.destinationSlot,Os.distributeView(this.contentView,r,n,i,this.destinationSlot.name)}},t.passThroughTo=function(e){this.destinationSlot=e},t.addNode=function(t,n,i,r){null!==this.contentView&&(this.contentView.removeNodes(),this.contentView.detached(),this.contentView.unbind(),this.contentView=null),n.viewSlot instanceof e?n.viewSlot.passThroughTo(this):(this.projections++,this.destinationSlot.addNode(t,n,i,r))},t.removeView=function(e,t){this.projections--,this.destinationSlot.removeView(e,t),this.needsFallbackRendering&&this.renderFallbackContent(null,_s,t)},t.removeAll=function(e){this.projections=0,this.destinationSlot.removeAll(e),this.needsFallbackRendering&&this.renderFallbackContent(null,_s,e)},t.projectFrom=function(e,t){this.destinationSlot.projectFrom(e,t)},t.created=function(e){this.ownerView=e},t.bind=function(e){this.contentView&&this.contentView.bind(e.bindingContext,e.overrideContext)},t.attached=function(){this.contentView&&this.contentView.attached()},t.detached=function(){this.contentView&&this.contentView.detached()},t.unbind=function(){this.contentView&&this.contentView.unbind()},n(e,[{key:"needsFallbackRendering",get:function(){return this.fallbackFactory&&0===this.projections}}]),e}(),As=function(){function e(e,t,n){this.anchor=e,this.anchor.isContentProjectionSource=!0,this.anchor.viewSlot=this,this.name=t,this.fallbackFactory=n,this.contentView=null,this.projections=0,this.children=[],this.projectFromAnchors=null,this.destinationSlots=null}var t=e.prototype;return t.addNode=function(e,t,n,i,r){if(null!==this.contentView&&(this.contentView.removeNodes(),this.contentView.detached(),this.contentView.unbind(),this.contentView=null),t.viewSlot instanceof Ss)t.viewSlot.passThroughTo(this);else if(null!==this.destinationSlots)Os.distributeNodes(e,[t],this.destinationSlots,this,i);else{t.auOwnerView=e,t.auProjectionSource=n,t.auAssignedSlot=this;var o=this._findAnchor(e,t,n,i);o.parentNode.insertBefore(t,o),this.children.push(t),this.projections++}},t.removeView=function(e,t){if(null!==this.destinationSlots)Os.undistributeView(e,this.destinationSlots,this);else if(this.contentView&&this.contentView.hasSlots)Os.undistributeView(e,this.contentView.slots,t);else{var n=this.children.find(function(e){return e.auSlotProjectFrom===t});if(n){for(var i=n.auProjectionChildren,r=0,o=i.length;r=i&&o!==e))return s.splice(u,0,t),c}return r.auProjectionChildren.push(t),r}}return this.anchor},t.projectTo=function(e){this.destinationSlots=e},t.projectFrom=function(e,t){var n=c.createComment("anchor"),i=this.anchor.parentNode;n.auSlotProjectFrom=t,n.auOwnerView=e,n.auProjectionChildren=[],i.insertBefore(n,this.anchor),this.children.push(n),null===this.projectFromAnchors&&(this.projectFromAnchors=[]),this.projectFromAnchors.push(n)},t.renderFallbackContent=function(e,t,n,i){if(null===this.contentView&&(this.contentView=this.fallbackFactory.create(this.ownerView.container),this.contentView.bind(this.ownerView.bindingContext,this.ownerView.overrideContext),this.contentView.insertNodesBefore(this.anchor)),this.contentView.hasSlots){var r=this.contentView.slots,o=this.projectFromAnchors;if(null!==o)for(var s in r)for(var a=r[s],u=0,l=o.length;uu;++u){var c=s[u];if(!c||"string"!=typeof c&&!c.name)throw new Error('Invalid bindable property at "'+u+'" for class "'+e.name+'". Expected either a string or an object with "name" property.');for(var h=new oa(c),d=!1,f=0,p=a.length;p>f;++f)if(a[f].name===h.name){d=!0;break}d||h.registerWith(e,n)}}}return n};var t=e.prototype;return t._tryAddHook=function(e,t){if("function"==typeof e[t]){for(var n,i=e[t].bind(e),r=1;void 0!==this[n=t+r.toString()];)r++;this[t]=!0,this[n]=i}},t._invokeHook=function(e,t,n,i,r){if(this.hasParent&&this.parent._invokeHook(e,t,n,i,r),this[e]){this[e+"1"](t,n,i,r);var o=e+"2";if(this[o]&&(this[o](t,n,i,r),this[o=e+"3"])){this[o](t,n,i,r);for(var s=4;void 0!==this[o=e+s.toString()];)this[o](t,n,i,r),s++}}},t.registerViewEngineHooks=function(e){this._tryAddHook(e,"beforeCompile"),this._tryAddHook(e,"afterCompile"),this._tryAddHook(e,"beforeCreate"),this._tryAddHook(e,"afterCreate"),this._tryAddHook(e,"beforeBind"),this._tryAddHook(e,"beforeUnbind")},t.getBindingLanguage=function(e){return this.bindingLanguage||(this.bindingLanguage=e)},t.patchInParent=function(e){var t=this.parent;this.parent=e||null,this.hasParent=null!==this.parent,null===e.parent&&(e.parent=t,e.hasParent=null!==t)},t.relativeToView=function(e){return et(e,this.viewUrl)},t.registerElement=function(e,t){Vs(this.elements,e,t,"an Element")},t.getElement=function(e){return this.elements[e]||(this.hasParent?this.parent.getElement(e):null)},t.mapAttribute=function(e){return this.attributeMap[e]||(this.hasParent?this.parent.mapAttribute(e):null)},t.registerAttribute=function(e,t,n){this.attributeMap[e]=n,Vs(this.attributes,e,t,"an Attribute")},t.getAttribute=function(e){return this.attributes[e]||(this.hasParent?this.parent.getAttribute(e):null)},t.registerValueConverter=function(e,t){Vs(this.valueConverters,e,t,"a ValueConverter")},t.getValueConverter=function(e){return this.valueConverters[e]||(this.hasParent?this.parent.getValueConverter(e):null)},t.registerBindingBehavior=function(e,t){Vs(this.bindingBehaviors,e,t,"a BindingBehavior")},t.getBindingBehavior=function(e){return this.bindingBehaviors[e]||(this.hasParent?this.parent.getBindingBehavior(e):null)},t.registerValue=function(e,t){Vs(this.values,e,t,"a value")},t.getValue=function(e){return this.values[e]||(this.hasParent?this.parent.getValue(e):null)},t.autoRegister=function(t,n){var i=we.getOwn(we.resource,n);return i?i instanceof la&&(e.convention(n,i),null===i.attributeName&&null===i.elementName&&la.convention(n.name,i),null===i.attributeName&&null===i.elementName&&(i.elementName=is(n.name))):((i=e.convention(n)||la.convention(n.name)||vo.convention(n.name)||go.convention(n.name)||os.convention(n.name))||((i=new la).elementName=is(n.name)),we.define(we.resource,i,n)),i.initialize(t,n),i.register(this),i},e}(),Rs=function(){function e(e,t,n,i,r,o,s){for(var a in this.container=e,this.viewFactory=t,this.resources=t.resources,this.fragment=n,this.firstChild=n.firstChild,this.lastChild=n.lastChild,this.controllers=i,this.bindings=r,this.children=o,this.slots=s,this.hasSlots=!1,this.fromCache=!1,this.isBound=!1,this.isAttached=!1,this.bindingContext=null,this.overrideContext=null,this.controller=null,this.viewModelScope=null,this.animatableElement=void 0,this._isUserControlled=!1,this.contentView=null,s){this.hasSlots=!0;break}}var t=e.prototype;return t.returnToCache=function(){this.viewFactory.returnViewToCache(this)},t.created=function(){var e,t,n=this.controllers;for(e=0,t=n.length;e=i?this.add(t):(t.insertNodesBefore(n[e].firstChild),n.splice(e,0,t),this.isAttached?(t.attached(),this.animateView(t,"enter")):void 0)},t.move=function(e,t){if(e!==t){var n=this.children,i=n[e];i.removeNodes(),i.insertNodesBefore(n[t].firstChild),n.splice(e,1),n.splice(t,0,i)}},t.remove=function(e,t,n){return this.removeAt(this.children.indexOf(e),t,n)},t.removeMany=function(e,t,n){var i,r=this,o=this.children,s=e.length,a=[];e.forEach(function(e){if(n)e.removeNodes();else{var t=r.animateView(e,"leave");t?a.push(t.then(function(){return e.removeNodes()})):e.removeNodes()}});var u=function(){if(r.isAttached)for(i=0;i=0&&o.splice(n,1)}};return a.length>0?Promise.all(a).then(function(){return u()}):u()},t.removeAt=function(e,t,n){var i=this,r=this.children[e],o=function(){return e=i.children.indexOf(r),r.removeNodes(),i.children.splice(e,1),i.isAttached&&r.detached(),t&&r.returnToCache(),r};if(!n){var s=this.animateView(r,"leave");if(s)return s.then(function(){return o()})}return o()},t.removeAll=function(e,t){var n,i=this,r=this.children,o=r.length,s=[];r.forEach(function(e){if(t)e.removeNodes();else{var n=i.animateView(e,"leave");n?s.push(n.then(function(){return e.removeNodes()})):e.removeNodes()}});var a=function(){if(i.isAttached)for(n=0;n0?Promise.all(s).then(function(){return a()}):a()},t.attached=function(){var e,t,n,i;if(!this.isAttached)for(this.isAttached=!0,e=0,t=(n=this.children).length;e=this.children.length?this.add(t):(Os.distributeView(t,this.projectToSlots,this,e),this.children.splice(e,0,t),this.isAttached&&t.attached())},t._projectionMove=function(e,t){if(e!==t){var n=this.children,i=n[e];Os.undistributeView(i,this.projectToSlots,this),Os.distributeView(i,this.projectToSlots,this,t),n.splice(e,1),n.splice(t,0,i)}},t._projectionRemove=function(e,t){Os.undistributeView(e,this.projectToSlots,this),this.children.splice(this.children.indexOf(e),1),this.isAttached&&e.detached(),t&&e.returnToCache()},t._projectionRemoveAt=function(e,t){var n=this.children[e];Os.undistributeView(n,this.projectToSlots,this),this.children.splice(e,1),this.isAttached&&n.detached(),t&&n.returnToCache()},t._projectionRemoveMany=function(e,t){var n=this;e.forEach(function(e){return n.remove(e,t)})},t._projectionRemoveAll=function(e){Os.undistributeAll(this.projectToSlots,this);for(var t=this.children,n=t.length,i=0;i0?this.cache=[]:this.cache=null,this.isCaching=this.cacheSize>0},t.getCachedView=function(){return null!==this.cache&&this.cache.pop()||null},t.returnViewToCache=function(e){e.isAttached&&e.detached(),e.isBound&&e.unbind(),null!==this.cache&&this.cache.length0)return t[0].split(".")[1]}function Ia(e){if(e.processed)throw new Error("This config instance has already been applied. To load more plugins or global resources, create a new FrameworkConfiguration instance.")}function Fa(e,t){return"Invalid "+t+" ["+e+"], "+t+" must be specified as functions or relative module IDs."}var qa,Da,za,Ha,Ua,Qa,Wa,$a,Ga=function(){function e(e){var t=this;this.aurelia=e,this.container=e.container,this.info=[],this.processed=!1,this.preTasks=[],this.postTasks=[],this.behaviorsToLoad=[],this.configuredPlugins=[],this.resourcesToLoad={},this.preTask(function(){return e.loader.normalize("aurelia-bootstrapper").then(function(e){return t.bootstrapperName=e})}),this.postTask(function(){return ja(e,t.resourcesToLoad,e.resources)})}var t=e.prototype;return t.instance=function(e,t){return this.container.registerInstance(e,t),this},t.singleton=function(e,t){return this.container.registerSingleton(e,t),this},t.transient=function(e,t){return this.container.registerTransient(e,t),this},t.preTask=function(e){return Ia(this),this.preTasks.push(e),this},t.postTask=function(e){return Ia(this),this.postTasks.push(e),this},t.feature=function(e,t){switch(void 0===t&&(t={}),typeof e){case"string":var n=/\/index$/i.test(e),i=n||Ba(e)?e:e+"/index",r=n?e.substr(0,e.length-6):e;this.info.push({moduleId:i,resourcesRelativeTo:[r,""],config:t});break;case"function":this.info.push({configure:e,config:t||{}});break;default:throw new Error(Fa(e,"feature"))}return this},t.globalResources=function(e){var t=this;Ia(this);for(var n,i=Array.isArray(e)?e:arguments,r=this.resourcesRelativeTo||["",""],o=0,s=i.length;o1?t.normalize(n.moduleId,n.resourcesRelativeTo[1]).then(function(e){return r(e)}):r(i)}if("function"==typeof n.configure)return-1!==e.configuredPlugins.indexOf(n.configure)?Promise.resolve():(e.configuredPlugins.push(n.configure),Promise.resolve(n.configure.call(null,e,n.config||{})));throw new Error(Fa(n.moduleId||n.configure,"plugin"));function r(i){return t.loadModule(i).then(function(t){if("configure"in t)return-1!==e.configuredPlugins.indexOf(t.configure)?Promise.resolve():Promise.resolve(t.configure(e,n.config||{})).then(function(){e.configuredPlugins.push(t.configure),e.resourcesRelativeTo=null,Ma.debug("Configured plugin "+n.moduleId+".")});e.resourcesRelativeTo=null,Ma.debug("Loaded plugin "+n.moduleId+".")})}}(e,n,t).then(r):(e.processed=!0,e.configuredPlugins=null,Promise.resolve())}().then(function(){return La(e,e.postTasks)})})},e}(),Ka=le,Xa=(Da=qa=function(){function e(e){this.elements=Object.create(null),this.allElements=Object.create(null),this.svg=e,this.registerUniversal("accesskey","accessKey"),this.registerUniversal("contenteditable","contentEditable"),this.registerUniversal("tabindex","tabIndex"),this.registerUniversal("textcontent","textContent"),this.registerUniversal("innerhtml","innerHTML"),this.registerUniversal("scrolltop","scrollTop"),this.registerUniversal("scrollleft","scrollLeft"),this.registerUniversal("readonly","readOnly"),this.register("label","for","htmlFor"),this.register("img","usemap","useMap"),this.register("input","maxlength","maxLength"),this.register("input","minlength","minLength"),this.register("input","formaction","formAction"),this.register("input","formenctype","formEncType"),this.register("input","formmethod","formMethod"),this.register("input","formnovalidate","formNoValidate"),this.register("input","formtarget","formTarget"),this.register("textarea","maxlength","maxLength"),this.register("td","rowspan","rowSpan"),this.register("td","colspan","colSpan"),this.register("th","rowspan","rowSpan"),this.register("th","colspan","colSpan")}var t=e.prototype;return t.register=function(e,t,n){e=e.toLowerCase(),t=t.toLowerCase(),(this.elements[e]=this.elements[e]||Object.create(null))[t]=n},t.registerUniversal=function(e,t){e=e.toLowerCase(),this.allElements[e]=t},t.map=function(e,t){if(this.svg.isStandardSvgAttribute(e,t))return t;e=e.toLowerCase(),t=t.toLowerCase();var n=this.elements[e];return void 0!==n&&t in n?n[t]:t in this.allElements?this.allElements[t]:/(?:^data-)|(?:^aria-)|:/.test(t)?t:Ot(t)},e}(),qa.inject=[ao],Da),Ya=function(){function e(e,t,n,i,r,o){this.observerLocator=e,this.targetProperty=t,this.parts=n,this.mode=i,this.lookupFunctions=r,this.attribute=this.attrToRemove=o,this.discrete=!1}return e.prototype.createBinding=function(e){return 3===this.parts.length?new eu(e,this.observerLocator,this.parts[1],this.mode,this.lookupFunctions,this.targetProperty,this.parts[0],this.parts[2]):new Ja(this.observerLocator,this.parts,e,this.targetProperty,this.mode,this.lookupFunctions)},e}();function Za(e,t){if("style"===t)oe("templating-binding").info('Internet Explorer does not support interpolation in "style" attributes. Use the style attribute\'s alias, "css" instead.');else if(e.parentElement&&"TEXTAREA"===e.parentElement.nodeName&&"textContent"===t)throw new Error('Interpolation binding cannot be used in the content of a textarea element. Use instead.')}var Ja=function(){function e(e,t,n,i,r,o){Za(n,i),this.observerLocator=e,this.parts=t,this.target=n,this.targetProperty=i,this.targetAccessor=e.getAccessor(n,i),this.mode=r,this.lookupFunctions=o}var t=e.prototype;return t.interpolate=function(){if(this.isBound){for(var e="",t=this.parts,n=0,i=t.length;n=Gn.oneTime?n.attributes[t].defaultBindingMode:Gn.oneWay},t.bind=function(e,t,n,i,r){var o=i||cs.attribute(n.attrName);return o.attributes[n.attrName]=new co(this.observerLocator,this.attributeMap.map(t.tagName,n.attrName),this.parser.parse(n.attrValue),void 0===n.defaultBindingMode||null===n.defaultBindingMode?this.determineDefaultBindingMode(t,n.attrName,r):n.defaultBindingMode,e.lookupFunctions),o},t.trigger=function(e,t,n){return new yo(this.eventManager,n.attrName,this.parser.parse(n.attrValue),Mr.none,!0,e.lookupFunctions)},t.capture=function(e,t,n){return new yo(this.eventManager,n.attrName,this.parser.parse(n.attrValue),Mr.capturing,!0,e.lookupFunctions)},t.delegate=function(e,t,n){return new yo(this.eventManager,n.attrName,this.parser.parse(n.attrValue),Mr.bubbling,!0,e.lookupFunctions)},t.call=function(e,t,n,i){var r=i||cs.attribute(n.attrName);return r.attributes[n.attrName]=new fo(this.observerLocator,n.attrName,this.parser.parse(n.attrValue),e.lookupFunctions),r},t.options=function(e,t,n,i,r){var o,s,a,u=i||cs.attribute(n.attrName),l=n.attrValue,c=this.language,h=null,d="",f=!1,p=!1,v=!1;for(s=0,a=l.length;sc;++c)if(r=(n=a[c]).name,o=n.nodeValue,i=r.split("."),r!==u)if(2===i.length){if("bind"!==i[1]){oe("templating-binding-language").warn('Detected invalid let command. Expected "'+i[0]+'.bind", given "'+r+'"');continue}s.push(new tu(this.observerLocator,Ot(i[0]),this.parser.parse(o),e.lookupFunctions,l))}else r=Ot(r),null===(i=this.parseInterpolation(e,o))&&oe("templating-binding-language").warn('Detected string literal in let bindings. Did you mean "'+r+".bind="+o+'" or "'+r+"=${"+o+'}" ?'),i?s.push(new iu(this.observerLocator,r,i,e.lookupFunctions,l)):s.push(new tu(this.observerLocator,r,new Dn(o),e.lookupFunctions,l));return s},n.inspectTextContent=function(e,t){var n=this.parseInterpolation(e,t);return null===n?null:new Ya(this.observerLocator,"textContent",n,Gn.oneWay,e.lookupFunctions,"textContent")},n.parseInterpolation=function(e,t){for(var n,i,r,o=t.indexOf("${",0),s=t.length,a=0,u=0,l=null,c=0;o>=0&&o0&&o0&&(t-=1);t0?(a=e.removeViews(d,!0,!e.viewsRequireLifecycle),s=function(){for(var o=0;on;)i--,e.removeView(i,!0,!e.viewsRequireLifecycle);for(var r=e.local,o=0;o0)return Promise.all(o).then(function(){var r=i._handleAddedSplices(e,t,n);Iu(e.views(),r)});var d=this._handleAddedSplices(e,t,n);Iu(e.views(),d)},t._handleAddedSplices=function(e,t,n){for(var i,r,o=t.length,s=0,a=n.length;su.index)&&(r=i);l0?Promise.all(h).then(function(){Iu(e.views(),0)}):Iu(e.views(),0)},t._getViewIndexByKey=function(e,t){var n,i;for(n=0,i=e.viewCount();n0?Promise.all(c).then(function(){Iu(e.views(),0)}):Iu(e.views(),0)},t._getViewIndexByValue=function(e,t){var n,i;for(n=0,i=e.viewCount();n0)for(o>s&&(o=s),n=0,i=o;n)<[^<]*)*<\/script>/gi,xl=function(){function e(){}return e.prototype.sanitize=function(e){return e.replace(wl,"")},e}(),kl=mo("sanitizeHTML")(vl=Ze(xl)(vl=function(){function e(e){this.sanitizer=e}return e.prototype.toView=function(e){return null==e?null:this.sanitizer.sanitize(e)},e}())||vl)||vl,Cl=Ca("replaceable")(ml=_a(ml=Ze(zs,Ms)(ml=function(){function e(e,t){this.viewFactory=e,this.viewSlot=t,this.view=null}var t=e.prototype;return t.bind=function(e,t){null===this.view&&(this.view=this.viewFactory.create(),this.viewSlot.add(this.view)),this.view.bind(e,t)},t.unbind=function(){this.view.unbind()},e}())||ml)||ml)||ml,_l=Ca("focus",Gn.twoWay)(gl=function(){function e(e,t){this.element=e,this.taskQueue=t,this.isAttached=!1,this.needsApply=!1}e.inject=function(){return[c.Element,_t]};var t=e.prototype;return t.valueChanged=function(e){this.isAttached?this._apply():this.needsApply=!0},t._apply=function(){var e=this;this.value?this.taskQueue.queueMicroTask(function(){e.value&&e.element.focus()}):this.element.blur()},t.attached=function(){this.isAttached=!0,this.needsApply&&(this.needsApply=!1,this._apply()),this.element.addEventListener("focus",this),this.element.addEventListener("blur",this)},t.detached=function(){this.isAttached=!1,this.element.removeEventListener("focus",this),this.element.removeEventListener("blur",this)},t.handleEvent=function(e){"focus"===e.type?this.value=!0:c.activeElement!==this.element&&(this.value=!1)},e}())||gl,El=/url\((?!['"]data)([^)]+)\)/gi;var Sl,Al=function(){function e(e){this.address=e,this._scoped=null,this._global=!1,this._alreadyGloballyInjected=!1}var t=e.prototype;return t.initialize=function(e,t){this._scoped=new t(this)},t.register=function(e,t){"scoped"===t?e.registerViewEngineHooks(this._scoped):this._global=!0},t.load=function(e){var t=this;return e.get(lt).loadText(this.address).catch(function(e){return null}).then(function(e){e=function(e,t){if("string"!=typeof t)throw new Error("Failed loading required CSS file: "+e);return t.replace(El,function(t,n){var i=n.charAt(0);return"'"!==i&&'"'!==i||(n=n.substr(1,n.length-2)),"url('"+et(n,e)+"')"})}(t.address,e),t._scoped.css=e,t._global&&(t._alreadyGloballyInjected=!0,c.injectStyles(e))})},e}(),Ol=function(){function e(e){this.owner=e,this.css=null}return e.prototype.beforeCompile=function(e,t,n){if(n.targetShadowDOM)c.injectStyles(this.css,e,!0);else if(u.scopedCSS){c.injectStyles(this.css,e,!0).setAttribute("scoped","scoped")}else this._global&&!this.owner._alreadyGloballyInjected&&(c.injectStyles(this.css),this.owner._alreadyGloballyInjected=!0)},e}();var Vl,Tl,Nl,Rl,Ml,Pl,Ll=bo("attr")(Sl=function(){function e(){}var t=e.prototype;return t.bind=function(e,t){e.targetObserver=new Ur(e.target,e.targetProperty)},t.unbind=function(e,t){},e}())||Sl,jl={bind:function(e,t,n){e.originalMode=e.mode,e.mode=this.mode},unbind:function(e,t){e.mode=e.originalMode,e.originalMode=null}},Bl=_e(jl)(Vl=bo("oneTime")(Vl=function(){this.mode=Gn.oneTime})||Vl)||Vl,Il=_e(jl)(Tl=bo("oneWay")(Tl=function(){this.mode=Gn.toView})||Tl)||Tl,Fl=_e(jl)(Nl=bo("toView")(Nl=function(){this.mode=Gn.toView})||Nl)||Nl,ql=_e(jl)(Rl=bo("fromView")(Rl=function(){this.mode=Gn.fromView})||Rl)||Rl,Dl=_e(jl)(Ml=bo("twoWay")(Ml=function(){this.mode=Gn.twoWay})||Ml)||Ml;function zl(e){var t=this,n=this.throttleState,i=+new Date-n.last;if(i>=n.delay)return clearTimeout(n.timeoutId),n.timeoutId=null,n.last=+new Date,void this.throttledMethod(e);n.newValue=e,null===n.timeoutId&&(n.timeoutId=setTimeout(function(){n.timeoutId=null,n.last=+new Date,t.throttledMethod(n.newValue)},n.delay-i))}var Hl,Ul=bo("throttle")(Pl=function(){function e(){}var t=e.prototype;return t.bind=function(e,t,n){void 0===n&&(n=200);var i="updateTarget";e.callSource?i="callSource":e.updateSource&&e.mode===Gn.twoWay&&(i="updateSource"),e.throttledMethod=e[i],e.throttledMethod.originalName=i,e[i]=zl,e.throttleState={delay:n,last:0,timeoutId:null}},t.unbind=function(e,t){e[e.throttledMethod.originalName]=e.throttledMethod,e.throttledMethod=null,clearTimeout(e.throttleState.timeoutId),e.throttleState=null},e}())||Pl,Ql={};function Wl(e){var t=this,n=this.debounceState;clearTimeout(n.timeoutId),n.timeoutId=setTimeout(function(){return t.debouncedMethod(e)},n.delay)}function $l(e,t,n){var i=this,r=this.debounceState;if(clearTimeout(r.timeoutId),e!==r.callContextToDebounce)return r.oldValue=Ql,void this.debouncedMethod(e,t,n);r.oldValue===Ql&&(r.oldValue=n),r.timeoutId=setTimeout(function(){var n=r.oldValue;r.oldValue=Ql,i.debouncedMethod(e,t,n)},r.delay)}var Gl,Kl=bo("debounce")(Hl=function(){function e(){}var t=e.prototype;return t.bind=function(e,t,n){void 0===n&&(n=200);var i=void 0!==e.callSource,r=i?"callSource":"call",o=i?Wl:$l,s=e.mode,a=s===Gn.twoWay||s===Gn.fromView?"Binding:target":St;e.debouncedMethod=e[r],e.debouncedMethod.originalName=r,e[r]=o,e.debounceState={callContextToDebounce:a,delay:n,timeoutId:0,oldValue:Ql}},t.unbind=function(e,t){e[e.debouncedMethod.originalName]=e.debouncedMethod,e.debouncedMethod=null,clearTimeout(e.debounceState.timeoutId),e.debounceState=null},e}())||Hl;function Xl(e){var t=function(e){return e.path&&e.path[0]||e.deepPath&&e.deepPath[0]||e.target}(e);this.target===t&&this.selfEventCallSource(e)}var Yl,Zl,Jl=bo("self")(Gl=function(){function e(){}var t=e.prototype;return t.bind=function(e,t){if(!e.callSource||!e.targetEvent)throw new Error("Self binding behavior only supports event.");e.selfEventCallSource=e.callSource,e.callSource=Xl},t.unbind=function(e,t){e.callSource=e.selfEventCallSource,e.selfEventCallSource=null},e}())||Gl,ec=function(){function e(){this.signals={}}return e.prototype.signal=function(e){var t=this.signals[e];if(t)for(var n=t.length;n--;)t[n].call(St)},e}(),tc=bo("signal")(Yl=function(){function e(e){this.signals=e.signals}e.inject=function(){return[ec]};var t=e.prototype;return t.bind=function(e,t){if(!e.updateTarget)throw new Error("Only property bindings and string interpolation bindings can be signaled. Trigger, delegate and call bindings cannot be signaled.");if(3===arguments.length){var n=arguments[2];(this.signals[n]||(this.signals[n]=[])).push(e),e.signalName=n}else{if(!(arguments.length>3))throw new Error("Signal name is required.");for(var i=Array.prototype.slice.call(arguments,2),r=i.length;r--;){var o=i[r];(this.signals[o]||(this.signals[o]=[])).push(e)}e.signalName=i}},t.unbind=function(e,t){var n=e.signalName;if(e.signalName=null,Array.isArray(n))for(var i=n,r=i.length;r--;){var o=i[r],s=this.signals[o];s.splice(s.indexOf(e),1)}else{var a=this.signals[n];a.splice(a.indexOf(e),1)}},e}())||Yl,nc="The updateTrigger binding behavior can only be applied to two-way/ from-view bindings on input/select elements.",ic=bo("updateTrigger")(Zl=function(){function e(){}var t=e.prototype;return t.bind=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r");if(e.mode!==Gn.twoWay&&e.mode!==Gn.fromView)throw new Error(nc);var o=e.observerLocator.getObserver(e.target,e.targetProperty);if(!o.handler)throw new Error(nc);e.targetObserver=o,o.originalHandler=e.targetObserver.handler;var s=new Lr(i);o.handler=s},t.unbind=function(e,t){e.targetObserver.handler.dispose(),e.targetObserver.handler=e.targetObserver.originalHandler,e.targetObserver.originalHandler=null},e}())||Zl;function rc(e,t,n){for(var i,r=ka(e)(i=Va(t)(i=function(){function e(){}return e.prototype.bind=function(e){this.$parent=e},e}())||i)||i,o=0,s=n.length;o1?n-1:0),r=1;r1?n-1:0),r=1;r1?n-1:0),r=1;r1?n-1:0),r=1;r1?t-1:0),i=1;i=1?r(e):r()},e.noView=Ta,e.observable=function(e,t,n){function i(e,t,n,i){var r=void 0===t;r&&(e=e.prototype,t="string"==typeof i?i:i.name);var o="_"+t,s={configurable:!0,enumerable:!1,writable:!0},a=i&&i.changeHandler||t+"Changed";if(n?"function"==typeof n.initializer&&(s.value=n.initializer()):n={},"enumerable"in n||(n.enumerable=!0),delete n.value,delete n.writable,delete n.initializer,Reflect.defineProperty(e,o,s),n.get=function(){return this[o]},n.set=function(e){var n=this[o];e!==n&&(this[o]=e,Reflect.defineProperty(this,o,{enumerable:!1}),this[a]&&this[a](e,n,t))},n.get.dependencies=[o],!r)return n;Reflect.defineProperty(e,t,n)}return void 0===t?function(t,n,r){return i(t,n,r,e)}:i(e,t,n)},e.optional=function(e){void 0===e&&(e=!0);var t=function(e){return function(t,n,i){var r=Fe(t);r[i]=Le.of(r[i],e)}};return t("boolean"!=typeof e||e)},e.parent=function(e,t,n){var i=Fe(e);i[n]=je.of(i[n])},e.parseQueryString=function(e){var t={};if(!e||"string"!=typeof e)return t;var n=e;"?"===n.charAt(0)&&(n=n.substr(1));for(var i=n.replace(/\+/g," ").split("&"),r=0;r=2){var l=o[1]?decodeURIComponent(o[1]):"";u?st(t,a,l):t[s]=ot(t[s],l)}else t[s]=!0}}return t},e.presentationAttributes=so,e.presentationElements=oo,e.processAttributes=function(e){return function(t){we.getOrCreateOwn(we.resource,la,t).processAttributes=function(t,n,i,r,o){try{e(t,n,i,r,o)}catch(e){oe("templating").error(e)}}}},e.processContent=function(e){return function(t){we.getOrCreateOwn(we.resource,la,t).processContent=e?function(t,n,i,r){try{return e(t,n,i,r)}catch(e){return oe("templating").error(e),!1}}:Aa}},e.projectArraySplices=dn,e.propertyAccessor=Fr,e.protocol=Te,e.registration=De,e.relativeToFile=et,e.reset=function(){e.isInitialized=!1},e.resolver=Ne,e.resource=xa,e.setConnectQueueThreshold=Gt,e.signalBindings=function(e){Ko.hasOwnProperty(e)&&Ko[e]++},e.singleton=function(e,t){return void 0===t&&(t=!1),De(new He(e,t))},e.sourceContext=St,e.start=function(e){return void 0===e&&(e={}),pc(e).then(function(t){return t.setRoot(e.root||"app.js",e.host||document.body)})},e.subscriberCollection=rn,e.targetContext="Binding:target",e.templateController=_a,e.transient=function(e){return De(new ze(e))},e.unwrapExpression=zu,e.updateOneTimeBinding=Uu,e.updateOverrideContext=qu,e.useShadowDOM=function(e){var t="function"!=typeof e&&e?e:Sa,n=function(e){var n=we.getOrCreateOwn(we.resource,la,e);n.targetShadowDOM=!0,n.shadowDOMOptions=t};return"function"==typeof e?n(e):n},e.useView=Va,e.useViewStrategy=Oa,e.validateBehaviorName=Ts,e.valueConverter=mo,e.view=function(e){return function(t){t.$view=e}},e.viewEngineHooks=function(e){var t=function(e){we.define(we.resource,new os,e)};return e?t(e):t},e.viewResources=function(){for(var e=arguments.length,t=new Array(e),n=0;n subjectString.length) { - position = subjectString.length; + if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { + position = subjectString.length; + } + + position -= searchString.length; + var lastIndex = subjectString.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; + }; + } + + if (!String.prototype.startsWith || function () { + try { + return !"ab".startsWith("b", 1); + } catch (e) { + return true; + } + }()) { + String.prototype.startsWith = function (searchString, position) { + position = position || 0; + return this.substr(position, searchString.length) === searchString; + }; + } + + if (typeof FEATURE_NO_ES2015 === 'undefined') { + 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; + } + }; + + 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; + }; + }(); + } + + 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; + } + }); + } + + 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; + } + }); + } + } + + if (typeof FEATURE_NO_ES2016 === 'undefined' && !Array.prototype.includes) { + Object.defineProperty(Array.prototype, 'includes', { + configurable: true, + writable: true, + enumerable: false, + value: function value(searchElement) { + var O = Object(this); + var len = parseInt(O.length) || 0; + + if (len === 0) { + return false; + } + + var n = parseInt(arguments[1]) || 0; + var k; + + if (n >= 0) { + k = n; + } else { + k = len + n; + + if (k < 0) { + k = 0; + } + } + + var currentElement; + + while (k < len) { + currentElement = O[k]; + + if (searchElement === currentElement || searchElement !== searchElement && currentElement !== currentElement) { + return true; + } + + k++; + } + + return false; + } + }); + } + + if (typeof FEATURE_NO_ES2015 === 'undefined') { + (function () { + var needsFix = false; + + try { + var s = Object.keys('a'); + needsFix = s.length !== 1 || s[0] !== '0'; + } catch (e) { + needsFix = true; + } + + 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); + var result = [], + prop, + i; + + 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]); + } + } + } + + return result; + }; + }(); + } + })(); + + (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; + }; + return function assign(where) { + if (gOPS && !(where instanceof O)) { + console.warn('problematic Symbols', where); + } + + function set(keyOrSymbol) { + where[keyOrSymbol] = arg[keyOrSymbol]; + } + + for (var i = 1, ii = arguments.length; i < ii; ++i) { + var arg = arguments[i]; + + if (arg === null || arg === undefined) { + continue; + } + + O.keys(arg).concat(filterOS(arg)).forEach(set); + } + + return where; + }; + }() + }); + })(Object); + + if (!Object.is) { + Object.is = function (x, y) { + if (x === y) { + return x !== 0 || 1 / x === 1 / y; + } else { + return x !== x && y !== y; + } + }; + } + } + + if (typeof FEATURE_NO_ES2015 === 'undefined') { + (function (global) { + var i; + + var defineProperty = Object.defineProperty, + is = function is(a, b) { + return a === b || a !== a && b !== b; + }; + + if (typeof WeakMap == 'undefined') { + global.WeakMap = createCollection({ + 'delete': sharedDelete, + clear: sharedClear, + get: sharedGet, + has: mapHas, + set: sharedSet + }, true); + } + + if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) { + var _createCollection; + + global.Map = createCollection((_createCollection = { + 'delete': sharedDelete, + has: mapHas, + get: sharedGet, + set: sharedSet, + keys: sharedKeys, + values: sharedValues, + entries: mapEntries, + forEach: sharedForEach, + clear: sharedClear + }, _createCollection[Symbol.iterator] = mapEntries, _createCollection)); + } + + if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) { + var _createCollection2; + + global.Set = createCollection((_createCollection2 = { + has: setHas, + add: sharedAdd, + 'delete': sharedDelete, + clear: sharedClear, + keys: sharedValues, + values: sharedValues, + entries: setEntries, + forEach: sharedForEach + }, _createCollection2[Symbol.iterator] = sharedValues, _createCollection2)); + } + + if (typeof WeakSet == 'undefined') { + global.WeakSet = createCollection({ + 'delete': sharedDelete, + add: sharedAdd, + clear: sharedClear, + 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 + }); + } + + proto.constructor = Collection; + Collection.prototype = proto; + return Collection; + } + + function init(a) { + if (this.add) a.forEach(this.add, this);else a.forEach(function (a) { + this.set(a[0], a[1]); + }, this); + } + + function sharedDelete(key) { + if (this.has(key)) { + this._keys.splice(i, 1); + + this._values.splice(i, 1); + + this._itp.forEach(function (p) { + if (i < p[0]) p[0]--; + }); + } + + return -1 < i; + } + + function sharedGet(key) { + return this.has(key) ? this._values[i] : undefined; + } + + function has(list, key) { + if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key"); + if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key); + return -1 < i; + } + + function setHas(value) { + return has.call(this, this._values, value); + } + + function mapHas(value) { + return has.call(this, this._keys, value); + } + + function sharedSet(key, value) { + this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value; + return this; + } + + function sharedAdd(value) { + if (!this.has(value)) this._values.push(value); + return this; + } + + function sharedClear() { + (this._keys || 0).length = this._values.length = 0; + } + + function sharedKeys() { + return sharedIterator(this._itp, this._keys); + } + + function sharedValues() { + return sharedIterator(this._itp, this._values); + } + + function mapEntries() { + return sharedIterator(this._itp, this._keys, this._values); + } + + function setEntries() { + return sharedIterator(this._itp, this._values, this._values); + } + + 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 sharedSize() { + return this._values.length; + } + + 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') { + var bind = Function.prototype.bind; + + if (typeof PLATFORM.global.Reflect === 'undefined') { + PLATFORM.global.Reflect = {}; + } + + 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.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]); + } + } + + var a = [null]; + a.push.apply(a, args); + return new (bind.apply(Target, a))(); + }; + } + + if (typeof Reflect.ownKeys !== 'function') { + Reflect.ownKeys = function (o) { + return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o)); + }; + } + } + + if (typeof FEATURE_NO_ESNEXT === 'undefined') { + 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]; + } + }; + } + + 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.metadata !== 'function') { + Reflect.metadata = function (metadataKey, metadataValue) { + return function (target, targetKey) { + Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); + }; + }; + } + } + + var _PLATFORM = { + location: window.location, + history: window.history, + addEventListener: function addEventListener(eventName, callback, capture) { + this.global.addEventListener(eventName, callback, capture); + }, + removeEventListener: function removeEventListener(eventName, callback, capture) { + this.global.removeEventListener(eventName, callback, capture); + }, + performance: window.performance, + requestAnimationFrame: function requestAnimationFrame(callback) { + return this.global.requestAnimationFrame(callback); + } + }; + + if (typeof FEATURE_NO_IE === 'undefined') { + var test = function test() {}; + + if (test.name === undefined) { + Object.defineProperty(Function.prototype, 'name', { + get: function get() { + var name = this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]; + Object.defineProperty(this, 'name', { + value: name + }); + return name; + } + }); + } + } + + if (typeof FEATURE_NO_IE === 'undefined') { + if (!('classList' in document.createElement('_')) || document.createElementNS && !('classList' in document.createElementNS('http://www.w3.org/2000/svg', 'g'))) { + var protoProp = 'prototype'; + var strTrim = String.prototype.trim; + var arrIndexOf = Array.prototype.indexOf; + var emptyArray = []; + + var DOMEx = function DOMEx(type, message) { + this.name = type; + this.code = DOMException[type]; + this.message = message; + }; + + var checkTokenAndGetIndex = function checkTokenAndGetIndex(classList, token) { + if (token === '') { + throw new DOMEx('SYNTAX_ERR', 'An invalid or illegal string was specified'); + } + + if (/\s/.test(token)) { + throw new DOMEx('INVALID_CHARACTER_ERR', 'String contains an invalid character'); + } + + return arrIndexOf.call(classList, token); + }; + + var ClassList = function ClassList(elem) { + var trimmedClasses = strTrim.call(elem.getAttribute('class') || ''); + var classes = trimmedClasses ? trimmedClasses.split(/\s+/) : emptyArray; + + for (var i = 0, ii = classes.length; i < ii; ++i) { + this.push(classes[i]); + } + + this._updateClassName = function () { + elem.setAttribute('class', this.toString()); + }; + }; + + var classListProto = ClassList[protoProp] = []; + DOMEx[protoProp] = Error[protoProp]; + + classListProto.item = function (i) { + return this[i] || null; + }; + + classListProto.contains = function (token) { + token += ''; + return checkTokenAndGetIndex(this, token) !== -1; + }; + + classListProto.add = function () { + var tokens = arguments; + var i = 0; + var ii = tokens.length; + var token; + var updated = false; + + do { + token = tokens[i] + ''; + + if (checkTokenAndGetIndex(this, token) === -1) { + this.push(token); + updated = true; + } + } while (++i < ii); + + if (updated) { + this._updateClassName(); + } + }; + + classListProto.remove = function () { + var tokens = arguments; + var i = 0; + var ii = tokens.length; + var token; + var updated = false; + var index; + + do { + token = tokens[i] + ''; + index = checkTokenAndGetIndex(this, token); + + while (index !== -1) { + this.splice(index, 1); + updated = true; + index = checkTokenAndGetIndex(this, token); + } + } while (++i < ii); + + if (updated) { + this._updateClassName(); + } + }; + + classListProto.toggle = function (token, force) { + token += ''; + var result = this.contains(token); + var method = result ? force !== true && 'remove' : force !== false && 'add'; + + if (method) { + this[method](token); + } + + if (force === true || force === false) { + return force; + } + + return !result; + }; + + classListProto.toString = function () { + return this.join(' '); + }; + + Object.defineProperty(Element.prototype, 'classList', { + get: function get() { + return new ClassList(this); + }, + enumerable: true, + configurable: true + }); + } else { + var testElement = document.createElement('_'); + testElement.classList.add('c1', 'c2'); + + if (!testElement.classList.contains('c2')) { + var createMethod = function createMethod(method) { + var original = DOMTokenList.prototype[method]; + + DOMTokenList.prototype[method] = function (token) { + for (var i = 0, ii = arguments.length; i < ii; ++i) { + token = arguments[i]; + original.call(this, token); + } + }; + }; + + createMethod('add'); + createMethod('remove'); } - position -= searchString.length; - var lastIndex = subjectString.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; - } + testElement.classList.toggle('c3', false); - if (!String.prototype.startsWith || function () { - try { - return !"ab".startsWith("b", 1); - } catch (e) { - return true; + if (testElement.classList.contains('c3')) { + var _toggle = DOMTokenList.prototype.toggle; + + DOMTokenList.prototype.toggle = function (token, force) { + if (1 in arguments && !this.contains(token) === !force) { + return force; + } + + return _toggle.call(this, token); + }; + } + + testElement = null; } - }()) { - String.prototype.startsWith = function (searchString, position) { - position = position || 0; - return this.substr(position, searchString.length) === searchString; - }; } - { - var emptyMetadata = Object.freeze({}); - var metadataContainerKey = '__metadata__'; + if (typeof FEATURE_NO_IE === 'undefined') { + var _filterEntries = function _filterEntries(key, value) { + var i = 0, + n = _entries.length, + result = []; - if (typeof Reflect.getOwnMetadata !== 'function') { - Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { - if (target.hasOwnProperty(metadataContainerKey)) { - return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; + for (; i < n; i++) { + if (_entries[i][key] == value) { + result.push(_entries[i]); } - }; + } + + return result; + }; + + var _clearEntries = function _clearEntries(type, name) { + var i = _entries.length, + entry; + + while (i--) { + entry = _entries[i]; + + if (entry.entryType == type && (name === void 0 || entry.name == name)) { + _entries.splice(i, 1); + } + } + }; + + // @license http://opensource.org/licenses/MIT + if ('performance' in window === false) { + window.performance = {}; } - 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 ('now' in window.performance === false) { + var nowOffset = Date.now(); + + if (performance.timing && performance.timing.navigationStart) { + nowOffset = performance.timing.navigationStart; + } + + window.performance.now = function now() { + return Date.now() - nowOffset; }; } + var _entries = []; + var _marksIndex = {}; - if (typeof Reflect.metadata !== 'function') { - Reflect.metadata = function (metadataKey, metadataValue) { - return function (target, targetKey) { - Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); + if (!window.performance.mark) { + window.performance.mark = window.performance.webkitMark || function (name) { + var mark = { + name: name, + entryType: "mark", + startTime: window.performance.now(), + duration: 0 }; + + _entries.push(mark); + + _marksIndex[name] = mark; + }; + } + + if (!window.performance.measure) { + window.performance.measure = window.performance.webkitMeasure || function (name, startMark, endMark) { + startMark = _marksIndex[startMark].startTime; + endMark = _marksIndex[endMark].startTime; + + _entries.push({ + name: name, + entryType: "measure", + startTime: startMark, + duration: endMark - startMark + }); }; } + + if (!window.performance.getEntriesByType) { + window.performance.getEntriesByType = window.performance.webkitGetEntriesByType || function (type) { + return _filterEntries("entryType", type); + }; + } + + if (!window.performance.getEntriesByName) { + window.performance.getEntriesByName = window.performance.webkitGetEntriesByName || function (name) { + return _filterEntries("name", name); + }; + } + + if (!window.performance.clearMarks) { + window.performance.clearMarks = window.performance.webkitClearMarks || function (name) { + _clearEntries("mark", name); + }; + } + + if (!window.performance.clearMeasures) { + window.performance.clearMeasures = window.performance.webkitClearMeasures || function (name) { + _clearEntries("measure", name); + }; + } + + _PLATFORM.performance = window.performance; } - var _PLATFORM = { - location: window.location, - history: window.history, - addEventListener: function addEventListener(eventName, callback, capture) { - this.global.addEventListener(eventName, callback, capture); - }, - removeEventListener: function removeEventListener(eventName, callback, capture) { - this.global.removeEventListener(eventName, callback, capture); - }, - performance: window.performance, - requestAnimationFrame: function requestAnimationFrame(callback) { - return this.global.requestAnimationFrame(callback); + if (typeof FEATURE_NO_IE === 'undefined') { + var con = window.console = window.console || {}; + + var nop = function nop() {}; + + if (!con.memory) con.memory = {}; + ('assert,clear,count,debug,dir,dirxml,error,exception,group,' + 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' + 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',').forEach(function (m) { + if (!con[m]) con[m] = nop; + }); + + if (typeof con.log === 'object') { + 'log,info,warn,error,assert,dir,clear,profile,profileEnd'.split(',').forEach(function (method) { + console[method] = this.bind(console[method], console); + }, Function.prototype.call); } - }; + } + + if (typeof FEATURE_NO_IE === 'undefined') { + if (!window.CustomEvent || typeof window.CustomEvent !== 'function') { + var CustomEvent = function CustomEvent(event, params) { + params = params || { + bubbles: false, + cancelable: false, + detail: undefined + }; + var evt = document.createEvent('CustomEvent'); + evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); + return evt; + }; + + CustomEvent.prototype = window.Event.prototype; + window.CustomEvent = CustomEvent; + } + } if (Element && !Element.prototype.matches) { var proto = Element.prototype; @@ -185,6 +1316,61 @@ } }; + if (typeof FEATURE_NO_IE === 'undefined') { + var isSVGTemplate = function isSVGTemplate(el) { + return el.tagName === 'template' && el.namespaceURI === 'http://www.w3.org/2000/svg'; + }; + + var fixSVGTemplateElement = function fixSVGTemplateElement(el) { + var template = el.ownerDocument.createElement('template'); + var attrs = el.attributes; + var length = attrs.length; + var attr; + el.parentNode.insertBefore(template, el); + + while (length-- > 0) { + attr = attrs[length]; + template.setAttribute(attr.name, attr.value); + el.removeAttribute(attr.name); + } + + el.parentNode.removeChild(el); + return fixHTMLTemplateElement(template); + }; + + var fixHTMLTemplateElement = function fixHTMLTemplateElement(template) { + var content = template.content = document.createDocumentFragment(); + var child; + + while (child = template.firstChild) { + content.appendChild(child); + } + + return template; + }; + + var fixHTMLTemplateElementRoot = function fixHTMLTemplateElementRoot(template) { + var content = fixHTMLTemplateElement(template).content; + var childTemplates = content.querySelectorAll('template'); + + for (var i = 0, ii = childTemplates.length; i < ii; ++i) { + var child = childTemplates[i]; + + if (isSVGTemplate(child)) { + fixSVGTemplateElement(child); + } else { + fixHTMLTemplateElement(child); + } + } + + return template; + }; + + if (!_FEATURE.htmlTemplateElement) { + _FEATURE.ensureHTMLTemplateElement = fixHTMLTemplateElementRoot; + } + } + var shadowPoly = window.ShadowDOMPolyfill || null; var _DOM = { Element: Element, @@ -1635,7 +2821,7 @@ }; } - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + var _typeof$1 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; @@ -1740,11 +2926,11 @@ if (traditional) { result.push(encodeKey(key) + '=' + encode(value[i])); } else { - var arrayKey = key + '[' + (_typeof(value[i]) === 'object' && value[i] !== null ? i : '') + ']'; + var arrayKey = key + '[' + (_typeof$1(value[i]) === 'object' && value[i] !== null ? i : '') + ']'; result = result.concat(buildParam(arrayKey, value[i])); } } - } else if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !traditional) { + } else if ((typeof value === 'undefined' ? 'undefined' : _typeof$1(value)) === 'object' && !traditional) { for (var propertyName in value) { result = result.concat(buildParam(key + '[' + propertyName + ']', value[propertyName])); } @@ -1792,7 +2978,7 @@ var key = keys[j] === '' ? currentParams.length : keys[j]; if (j < keysLastIndex) { - var prevValue = !currentParams[key] || _typeof(currentParams[key]) === 'object' ? currentParams[key] : [currentParams[key]]; + var prevValue = !currentParams[key] || _typeof$1(currentParams[key]) === 'object' ? currentParams[key] : [currentParams[key]]; currentParams = currentParams[key] = prevValue || (isNaN(keys[j + 1]) ? {} : []); } else { currentParams = currentParams[key] = value; @@ -3342,7 +4528,7 @@ }; _proto4.toString = function toString() { - return Object.prototype.toString.call(this); + return typeof FEATURE_NO_UNPARSER === 'undefined' ? exports.Unparser.unparse(this) : Object.prototype.toString.call(this); }; return Expression; @@ -4338,6 +5524,222 @@ exports.Unparser = null; + if (typeof FEATURE_NO_UNPARSER === 'undefined') { + exports.Unparser = + /*#__PURE__*/ + function () { + function Unparser(buffer) { + this.buffer = buffer; + } + + Unparser.unparse = function unparse(expression) { + var buffer = []; + var visitor = new exports.Unparser(buffer); + expression.accept(visitor); + return buffer.join(''); + }; + + var _proto23 = Unparser.prototype; + + _proto23.write = function write(text) { + this.buffer.push(text); + }; + + _proto23.writeArgs = function writeArgs(args) { + this.write('('); + + for (var _i17 = 0, length = args.length; _i17 < length; ++_i17) { + if (_i17 !== 0) { + this.write(','); + } + + args[_i17].accept(this); + } + + this.write(')'); + }; + + _proto23.visitBindingBehavior = function visitBindingBehavior(behavior) { + var args = behavior.args; + behavior.expression.accept(this); + this.write("&" + behavior.name); + + for (var _i18 = 0, length = args.length; _i18 < length; ++_i18) { + this.write(':'); + + args[_i18].accept(this); + } + }; + + _proto23.visitValueConverter = function visitValueConverter(converter) { + var args = converter.args; + converter.expression.accept(this); + this.write("|" + converter.name); + + for (var _i19 = 0, length = args.length; _i19 < length; ++_i19) { + this.write(':'); + + args[_i19].accept(this); + } + }; + + _proto23.visitAssign = function visitAssign(assign) { + assign.target.accept(this); + this.write('='); + assign.value.accept(this); + }; + + _proto23.visitConditional = function visitConditional(conditional) { + conditional.condition.accept(this); + this.write('?'); + conditional.yes.accept(this); + this.write(':'); + conditional.no.accept(this); + }; + + _proto23.visitAccessThis = function visitAccessThis(access) { + if (access.ancestor === 0) { + this.write('$this'); + return; + } + + this.write('$parent'); + var i = access.ancestor - 1; + + while (i--) { + this.write('.$parent'); + } + }; + + _proto23.visitAccessScope = function visitAccessScope(access) { + var i = access.ancestor; + + while (i--) { + this.write('$parent.'); + } + + this.write(access.name); + }; + + _proto23.visitAccessMember = function visitAccessMember(access) { + access.object.accept(this); + this.write("." + access.name); + }; + + _proto23.visitAccessKeyed = function visitAccessKeyed(access) { + access.object.accept(this); + this.write('['); + access.key.accept(this); + this.write(']'); + }; + + _proto23.visitCallScope = function visitCallScope(call) { + var i = call.ancestor; + + while (i--) { + this.write('$parent.'); + } + + this.write(call.name); + this.writeArgs(call.args); + }; + + _proto23.visitCallFunction = function visitCallFunction(call) { + call.func.accept(this); + this.writeArgs(call.args); + }; + + _proto23.visitCallMember = function visitCallMember(call) { + call.object.accept(this); + this.write("." + call.name); + this.writeArgs(call.args); + }; + + _proto23.visitPrefix = function visitPrefix(prefix) { + this.write("(" + prefix.operation); + + if (prefix.operation.charCodeAt(0) >= 97) { + this.write(' '); + } + + prefix.expression.accept(this); + this.write(')'); + }; + + _proto23.visitBinary = function visitBinary(binary) { + binary.left.accept(this); + + if (binary.operation.charCodeAt(0) === 105) { + this.write(" " + binary.operation + " "); + } else { + this.write(binary.operation); + } + + binary.right.accept(this); + }; + + _proto23.visitLiteralPrimitive = function visitLiteralPrimitive(literal) { + this.write("" + literal.value); + }; + + _proto23.visitLiteralArray = function visitLiteralArray(literal) { + var elements = literal.elements; + this.write('['); + + for (var _i20 = 0, length = elements.length; _i20 < length; ++_i20) { + if (_i20 !== 0) { + this.write(','); + } + + elements[_i20].accept(this); + } + + this.write(']'); + }; + + _proto23.visitLiteralObject = function visitLiteralObject(literal) { + var keys = literal.keys; + var values = literal.values; + this.write('{'); + + for (var _i21 = 0, length = keys.length; _i21 < length; ++_i21) { + if (_i21 !== 0) { + this.write(','); + } + + this.write("'" + keys[_i21] + "':"); + + values[_i21].accept(this); + } + + this.write('}'); + }; + + _proto23.visitLiteralString = function visitLiteralString(literal) { + var escaped = literal.value.replace(/'/g, "\'"); + this.write("'" + escaped + "'"); + }; + + _proto23.visitLiteralTemplate = function visitLiteralTemplate(literal) { + var cooked = literal.cooked, + expressions = literal.expressions; + var length = expressions.length; + this.write('`'); + this.write(cooked[0]); + + for (var _i22 = 0; _i22 < length; _i22++) { + expressions[_i22].accept(this); + + this.write(cooked[_i22 + 1]); + } + + this.write('`'); + }; + + return Unparser; + }(); + } + var ExpressionCloner = /*#__PURE__*/ function () { diff --git a/dist/aurelia_router_no_loader.es5.umd.min.js b/dist/aurelia_router_no_loader.es5.umd.min.js index 937ebcc..b231b58 100644 --- a/dist/aurelia_router_no_loader.es5.umd.min.js +++ b/dist/aurelia_router_no_loader.es5.umd.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).au={})}(this,function(e){"use strict";function t(e,t,n){if(t){if(t.innerError&&n)return t;var i="\n------------------------------------------------\n";e+=i+"Inner Error:\n","string"==typeof t?e+="Message: "+t:(t.message?e+="Message: "+t.message:e+="Unknown Inner Error Type. Displaying Inner Error as JSON:\n "+JSON.stringify(t,null," "),t.stack&&(e+="\nInner Error Stack:\n"+t.stack,e+="\nEnd Inner Error Stack")),e+=i}var r=new Error(e);return t&&(r.innerError=t),r}var n={},i={noop:function(){},eachModule:function(){},moduleName:function(e){return e}};i.global="undefined"!=typeof self?self:"undefined"!=typeof global?global:new Function("return this")();var r={};function o(t){e.isInitialized||(e.isInitialized=!0,"function"!=typeof Object.getPropertyDescriptor&&(Object.getPropertyDescriptor=function(e,t){for(var n=Object.getOwnPropertyDescriptor(e,t),i=Object.getPrototypeOf(e);void 0===n&&null!==i;)n=Object.getOwnPropertyDescriptor(i,t),i=Object.getPrototypeOf(i);return n}),t(i,n,r))}e.isInitialized=!1,String.prototype.endsWith&&!function(){try{return!"ab".endsWith("a",1)}catch(e){return!0}}()||(String.prototype.endsWith=function(e,t){var n=this.toString();("number"!=typeof t||!isFinite(t)||Math.floor(t)!==t||t>n.length)&&(t=n.length),t-=e.length;var i=n.indexOf(e,t);return-1!==i&&i===t}),String.prototype.startsWith&&!function(){try{return!"ab".startsWith("b",1)}catch(e){return!0}}()||(String.prototype.startsWith=function(e,t){return t=t||0,this.substr(t,e.length)===e});var s=Object.freeze({});"function"!=typeof Reflect.getOwnMetadata&&(Reflect.getOwnMetadata=function(e,t,n){if(t.hasOwnProperty("__metadata__"))return(t.__metadata__[n]||s)[e]}),"function"!=typeof Reflect.defineMetadata&&(Reflect.defineMetadata=function(e,t,n,i){var r=n.hasOwnProperty("__metadata__")?n.__metadata__:n.__metadata__={};(r[i]||(r[i]={}))[e]=t}),"function"!=typeof Reflect.metadata&&(Reflect.metadata=function(e,t){return function(n,i){Reflect.defineMetadata(e,t,n,i)}});var a={location:window.location,history:window.history,addEventListener:function(e,t,n){this.global.addEventListener(e,t,n)},removeEventListener:function(e,t,n){this.global.removeEventListener(e,t,n)},performance:window.performance,requestAnimationFrame:function(e){return this.global.requestAnimationFrame(e)}};if(Element&&!Element.prototype.matches){var u=Element.prototype;u.matches=u.matchesSelector||u.mozMatchesSelector||u.msMatchesSelector||u.oMatchesSelector||u.webkitMatchesSelector}var c,l={shadowDOM:!!HTMLElement.prototype.attachShadow,scopedCSS:"scoped"in document.createElement("style"),htmlTemplateElement:(c=document.createElement("div"),c.innerHTML="","content"in c.children[0]),mutationObserver:!(!window.MutationObserver&&!window.WebKitMutationObserver),ensureHTMLTemplateElement:function(e){return e}},h=window.ShadowDOMPolyfill||null,d={Element:Element,NodeList:NodeList,SVGElement:SVGElement,boundary:"aurelia-dom-boundary",addEventListener:function(e,t,n){document.addEventListener(e,t,n)},removeEventListener:function(e,t,n){document.removeEventListener(e,t,n)},adoptNode:function(e){return document.adoptNode(e)},createAttribute:function(e){return document.createAttribute(e)},createElement:function(e){return document.createElement(e)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},createDocumentFragment:function(){return document.createDocumentFragment()},createTemplateElement:function(){var e=document.createElement("template");return l.ensureHTMLTemplateElement(e)},createMutationObserver:function(e){return new(window.MutationObserver||window.WebKitMutationObserver)(e)},createCustomEvent:function(e,t){return new window.CustomEvent(e,t)},dispatchEvent:function(e){document.dispatchEvent(e)},getComputedStyle:function(e){return window.getComputedStyle(e)},getElementById:function(e){return document.getElementById(e)},querySelector:function(e){return document.querySelector(e)},querySelectorAll:function(e){return document.querySelectorAll(e)},nextElementSibling:function(e){if(e.nextElementSibling)return e.nextElementSibling;do{e=e.nextSibling}while(e&&1!==e.nodeType);return e},createTemplateFromMarkup:function(e){var t=document.createElement("div");t.innerHTML=e;var n=t.firstElementChild;if(!n||"TEMPLATE"!==n.nodeName)throw new Error("Template markup must be wrapped in a ","content"in j.children[0]),mutationObserver:!(!window.MutationObserver&&!window.WebKitMutationObserver),ensureHTMLTemplateElement:function(e){return e}};if("undefined"==typeof FEATURE_NO_IE){var F=function(e){var t,n=e.ownerDocument.createElement("template"),i=e.attributes,r=i.length;for(e.parentNode.insertBefore(n,e);r-- >0;)t=i[r],n.setAttribute(t.name,t.value),e.removeAttribute(t.name);return e.parentNode.removeChild(e),q(n)},q=function(e){for(var t,n=e.content=document.createDocumentFragment();t=e.firstChild;)n.appendChild(t);return e};B.htmlTemplateElement||(B.ensureHTMLTemplateElement=function(e){for(var t,n=q(e).content.querySelectorAll("template"),i=0,r=n.length;i element e.g. ");return B.ensureHTMLTemplateElement(n)},appendNode:function(e,t){(t||document.body).appendChild(e)},replaceNode:function(e,t,n){t.parentNode?t.parentNode.replaceChild(e,t):null!==D?D.unwrap(n).replaceChild(D.unwrap(e),D.unwrap(t)):n.replaceChild(e,t)},removeNode:function(e,t){e.parentNode?e.parentNode.removeChild(e):t&&(null!==D?D.unwrap(t).removeChild(D.unwrap(e)):t.removeChild(e))},injectStyles:function(e,t,n,i){if(i){var r=document.getElementById(i);if(r){if("style"===r.tagName.toLowerCase())return void(r.innerHTML=e);throw new Error("The provided id does not indicate a style tag.")}}var o=document.createElement("style");return o.innerHTML=e,o.type="text/css",i&&(o.id=i),t=t||document.head,n&&t.childNodes.length>0?t.insertBefore(o,t.childNodes[0]):t.appendChild(o),o}};var H={none:0,error:10,warn:20,info:30,debug:40},U={},W=[],Q=H.none,$=["none","error","warn","info","debug"];function G(e){return $.filter(function(t){return t===e}).length>0}function K(){return[this].concat(Array.prototype.slice.call(arguments))}function X(e){var t=H[e];return function(){if(!(this.level0?J():ne.prototype[e]=function(){}},removeCustomLevel:function(e){if(void 0!==H[e]){if(G(e))throw Error('Built-in log level "'+e+'" cannot be removed.');delete H[e],delete ne.prototype[e]}},setLevel:te,getLevel:function(){return Q},Logger:ne});function re(e,t){for(var n=0;n1?t-1:0),i=1;i0?this.dynamicDependencies.map(function(t){return t["protocol:aurelia:resolver"]?t.get(e):e.get(t)}):void 0,n=this.key,i=e.getResolver(n);i&&3===i.strategy&&(n=i.state);var r=e.invoke(n,t);return e.registerInstance(this.asKey,r),r},t.as=function(e){return this.asKey=e,this},e.of=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r0&&e.inject[e.inject.length-1]===Object&&e.inject.pop())};return e?t(e):t}function Je(){for(var e=arguments.length,t=new Array(e),n=0;n0&&(e.splice(t-1,2),t-=2)}}}(i),i.join("/")}function tt(e,t){if(!e)return t;if(!t)return e;var n=e.match(/^([^\/]*?:)\//),i=n&&n.length>0?n[1]:"",r=void 0;r=0===(e=e.substr(i.length)).indexOf("///")&&"file:"===i?"///":0===e.indexOf("//")?"//":0===e.indexOf("/")?"/":"";for(var o="/"===t.slice(-1)?"/":"",s=e.split("/"),a=t.split("/"),u=[],c=0,l=s.length;c=2){var c=o[1]?decodeURIComponent(o[1]):"";u?at(t,a,c):t[s]=st(t[s],c)}else t[s]=!0}}return t}var ct=function(e,t){this.src=e,this.name=t},lt=function(){function e(e){this.templateIsLoaded=!1,this.factoryIsReady=!1,this.resources=null,this.dependencies=null,this.address=e,this.onReady=null,this._template=null,this._factory=null}return e.prototype.addDependency=function(e,t){var n="string"==typeof e?et(e,this.address):Ce.get(e).moduleId;this.dependencies.push(new ct(n,t))},oe(e,[{key:"template",get:function(){return this._template},set:function(e){var t,n,i,r,o=this.address;this._template=e,this.templateIsLoaded=!0,t=e.content.querySelectorAll("require"),r=this.dependencies=new Array(t.length);for(var s=0,a=t.length;s element in "+o+' has no "from" attribute.');r[s]=new ct(et(i,o),n.getAttribute("as")),n.parentNode&&n.parentNode.removeChild(n)}}},{key:"factory",get:function(){return this._factory},set:function(e){this._factory=e,this.factoryIsReady=!0}}]),e}(),ht=function(){function e(){this.templateRegistry={}}var t=e.prototype;return t.map=function(e,t){throw new Error("Loaders must implement map(id, source).")},t.normalizeSync=function(e,t){throw new Error("Loaders must implement normalizeSync(moduleId, relativeTo).")},t.normalize=function(e,t){throw new Error("Loaders must implement normalize(moduleId: string, relativeTo: string): Promise.")},t.loadModule=function(e){throw new Error("Loaders must implement loadModule(id).")},t.loadAllModules=function(e){throw new Error("Loader must implement loadAllModules(ids).")},t.loadTemplate=function(e){throw new Error("Loader must implement loadTemplate(url).")},t.loadText=function(e){throw new Error("Loader must implement loadText(url).")},t.applyPluginToUrl=function(e,t){throw new Error("Loader must implement applyPluginToUrl(url, pluginName).")},t.addPlugin=function(e,t){throw new Error("Loader must implement addPlugin(pluginName, implementation).")},t.getOrCreateTemplateRegistryEntry=function(e){return this.templateRegistry[e]||(this.templateRegistry[e]=new lt(e))},e}();function dt(e){return function(){var t=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(t),clearInterval(n),e()}}}var ft,pt,vt,gt,mt,yt,bt,wt,xt,kt,Ct,_t,St,Et=function(){function e(){var e,t,i,o,s,a=this;this.flushing=!1,this.longStacks=!1,this.microTaskQueue=[],this.microTaskQueueCapacity=1024,this.taskQueue=[],n.mutationObserver?this.requestFlushMicroTaskQueue=(e=function(){return a.flushMicroTaskQueue()},t=r.createMutationObserver(e),i="a",o=r.createTextNode("a"),(s=Object.create(null)).a="b",s.b="a",t.observe(o,{characterData:!0}),function(){o.data=i=s[i]}):this.requestFlushMicroTaskQueue=dt(function(){return a.flushMicroTaskQueue()}),this.requestFlushTaskQueue=dt(function(){return a.flushTaskQueue()})}var t=e.prototype;return t._flushQueue=function(e,t){var n,i=0;try{for(this.flushing=!0;it){for(var r=0,o=e.length-i;rWt)break}Dt.splice(0,n),Dt.length?i.requestAnimationFrame(Gt):(Qt=!1,$t=0)}function Kt(e){if($tr;)r++;return!(r>=n.length)&&(i.splice(r,1),n.splice(r,1),!0)}var Zt=[],en=[],tn=[];function nn(e,t){var n,i,r,o,s=this._context0,a=this._callable0,u=this._context1,c=this._callable1,l=this._context2,h=this._callable2,d=this._contextsRest?this._contextsRest.length:0;if(d){for(r=tn.length;r--&&tn[r];);for(r<0?(r=tn.length,n=[],i=[],tn.push(!0),Zt.push(n),en.push(i)):(tn[r]=!0,n=Zt[r],i=en[r]),o=d;o--;)n[o]=this._contextsRest[o],i[o]=this._callablesRest[o]}if(s&&(a?a.call(s,e,t):s(e,t)),u&&(c?c.call(u,e,t):u(e,t)),l&&(h?h.call(l,e,t):l(e,t)),d){for(o=0;o0||n>0;)if(0!==t)if(0!==n){var o=e[t-1][n-1],s=e[t-1][n],a=e[t][n-1],u=void 0;(u=s=0){e.splice(h,1),h--,l-=d.addedCount-d.removed.length,u.addedCount+=d.addedCount-f;var p=u.removed.length+d.removed.length-f;if(u.addedCount||p){var v=d.removed;if(u.indexd.index+d.addedCount){var m=u.removed.slice(d.index+d.addedCount-u.index);Array.prototype.push.apply(v,m)}u.removed=v,d.index>>0)continue;var s=un(o.name);if(s<0)continue;fn(i,s,[o.oldValue],"delete"===o.type?0:1);break;default:console.error("Unexpected record type: "+JSON.stringify(o))}}return i}(0,t).forEach(function(t){1!==t.addedCount||1!==t.removed.length?n=n.concat(dn(e,t.index,t.index+t.addedCount,t.removed,0,t.removed.length)):t.removed[0]!==e[t.index]&&n.push(t)}),n}function vn(e){for(var t,n,i,r,o=new Array(e.size),s=e.keys(),a=0;(t=s.next())&&!t.done;)o[a]=(n="added",i=e,r=t.value,{type:n,object:i,key:r,oldValue:void 0}),a++;return o}var gn=sn()(pt=function(){function e(e,t){this.taskQueue=e,this.queued=!1,this.changeRecords=null,this.oldCollection=null,this.collection=t,this.lengthPropertyName=t instanceof Map||t instanceof Set?"size":"length"}var t=e.prototype;return t.subscribe=function(e,t){this.addSubscriber(e,t)},t.unsubscribe=function(e,t){this.removeSubscriber(e,t)},t.addChangeRecord=function(e){if(this.hasSubscribers()||this.lengthObserver){if("splice"===e.type){var t=e.index,n=e.object.length;t>n?t=n-e.addedCount:t<0&&(t=n+e.removed.length+t-e.addedCount),t<0&&(t=0),e.index=t}null===this.changeRecords?this.changeRecords=[e]:this.changeRecords.push(e),this.queued||(this.queued=!0,this.taskQueue.queueMicroTask(this))}},t.flushChangeRecords=function(){(this.changeRecords&&this.changeRecords.length||this.oldCollection)&&this.call()},t.reset=function(e){this.oldCollection=e,this.hasSubscribers()&&!this.queued&&(this.queued=!0,this.taskQueue.queueMicroTask(this))},t.getLengthObserver=function(){return this.lengthObserver||(this.lengthObserver=new mn(this.collection))},t.call=function(){var e,t=this.changeRecords,n=this.oldCollection;this.queued=!1,this.changeRecords=[],this.oldCollection=null,this.hasSubscribers()&&(e=n?this.collection instanceof Map||this.collection instanceof Set?vn(n):dn(this.collection,0,this.collection.length,n,0,n.length):this.collection instanceof Map||this.collection instanceof Set?t:pn(this.collection,t),this.callSubscribers(e)),this.lengthObserver&&this.lengthObserver.call(this.collection[this.lengthPropertyName])},e}())||pt,mn=sn()(vt=function(){function e(e){this.collection=e,this.lengthPropertyName=e instanceof Map||e instanceof Set?"size":"length",this.currentValue=e[this.lengthPropertyName]}var t=e.prototype;return t.getValue=function(){return this.collection[this.lengthPropertyName]},t.setValue=function(e){this.collection[this.lengthPropertyName]=e},t.subscribe=function(e,t){this.addSubscriber(e,t)},t.unsubscribe=function(e,t){this.removeSubscriber(e,t)},t.call=function(e){var t=this.currentValue;this.callSubscribers(e,t),this.currentValue=e},e}())||vt,yn=Array.prototype,bn=yn.pop,wn=yn.push,xn=yn.reverse,kn=yn.shift,Cn=yn.sort,_n=yn.splice,Sn=yn.unshift;function En(e,t){return An.for(e,t)}yn.__au_patched__?Z("array-observation").warn("Detected 2nd attempt of patching array from Aurelia binding. This is probably caused by dependency mismatch between core modules and a 3rd party plugin. Please see https://github.com/aurelia/cli/pull/906 if you are using webpack."):(Reflect.defineProperty(yn,"__au_patched__",{value:1}),yn.pop=function(){var e=this.length>0,t=bn.apply(this,arguments);return e&&void 0!==this.__array_observer__&&this.__array_observer__.addChangeRecord({type:"delete",object:this,name:this.length,oldValue:t}),t},yn.push=function(){var e=wn.apply(this,arguments);return void 0!==this.__array_observer__&&this.__array_observer__.addChangeRecord({type:"splice",object:this,index:this.length-arguments.length,removed:[],addedCount:arguments.length}),e},yn.reverse=function(){var e;void 0!==this.__array_observer__&&(this.__array_observer__.flushChangeRecords(),e=this.slice());var t=xn.apply(this,arguments);return void 0!==this.__array_observer__&&this.__array_observer__.reset(e),t},yn.shift=function(){var e=this.length>0,t=kn.apply(this,arguments);return e&&void 0!==this.__array_observer__&&this.__array_observer__.addChangeRecord({type:"delete",object:this,name:0,oldValue:t}),t},yn.sort=function(){var e;void 0!==this.__array_observer__&&(this.__array_observer__.flushChangeRecords(),e=this.slice());var t=Cn.apply(this,arguments);return void 0!==this.__array_observer__&&this.__array_observer__.reset(e),t},yn.splice=function(){var e=_n.apply(this,arguments);return void 0!==this.__array_observer__&&this.__array_observer__.addChangeRecord({type:"splice",object:this,index:+arguments[0],removed:e,addedCount:arguments.length>2?arguments.length-2:0}),e},yn.unshift=function(){var e=Sn.apply(this,arguments);return void 0!==this.__array_observer__&&this.__array_observer__.addChangeRecord({type:"splice",object:this,index:0,removed:[],addedCount:arguments.length}),e});var An=function(e){function t(t,n){return e.call(this,t,n)||this}return se(t,e),t.for=function(e,n){return"__array_observer__"in n||Reflect.defineProperty(n,"__array_observer__",{value:t.create(e,n),enumerable:!1,configurable:!1}),n.__array_observer__},t.create=function(e,n){return new t(e,n)},t}(gn),On=function(){function t(){this.isAssignable=!1}var n=t.prototype;return n.evaluate=function(e,t,n){throw new Error('Binding expression "'+this+'" cannot be evaluated.')},n.assign=function(e,t,n){throw new Error('Binding expression "'+this+'" cannot be assigned to.')},n.toString=function(){return"undefined"==typeof FEATURE_NO_UNPARSER?e.Unparser.unparse(this):Object.prototype.toString.call(this)},t}(),Rn=function(e){function t(t,n,i){var r;return(r=e.call(this)||this).expression=t,r.name=n,r.args=i,r}se(t,e);var n=t.prototype;return n.evaluate=function(e,t){return this.expression.evaluate(e,t)},n.assign=function(e,t,n){return this.expression.assign(e,t,n)},n.accept=function(e){return e.visitBindingBehavior(this)},n.connect=function(e,t){this.expression.connect(e,t)},n.bind=function(e,t,n){this.expression.expression&&this.expression.bind&&this.expression.bind(e,t,n);var i=n.bindingBehaviors(this.name);if(!i)throw new Error('No BindingBehavior named "'+this.name+'" was found!');var r="behavior-"+this.name;if(e[r])throw new Error('A binding behavior named "'+this.name+'" has already been applied to "'+this.expression+'"');e[r]=i,i.bind.apply(i,[e,t].concat($n(t,this.args,e.lookupFunctions)))},n.unbind=function(e,t){var n="behavior-"+this.name;e[n].unbind(e,t),e[n]=null,this.expression.expression&&this.expression.unbind&&this.expression.unbind(e,t)},t}(On),Pn=function(e){function t(t,n,i){var r;return(r=e.call(this)||this).expression=t,r.name=n,r.args=i,r.allArgs=[t].concat(i),r}se(t,e);var n=t.prototype;return n.evaluate=function(e,t){var n=t.valueConverters(this.name);if(!n)throw new Error('No ValueConverter named "'+this.name+'" was found!');return"toView"in n?n.toView.apply(n,$n(e,this.allArgs,t)):this.allArgs[0].evaluate(e,t)},n.assign=function(e,t,n){var i=n.valueConverters(this.name);if(!i)throw new Error('No ValueConverter named "'+this.name+'" was found!');return"fromView"in i&&(t=i.fromView.apply(i,[t].concat($n(e,this.args,n)))),this.allArgs[0].assign(e,t,n)},n.accept=function(e){return e.visitValueConverter(this)},n.connect=function(e,t){for(var n=this.allArgs,i=n.length;i--;)n[i].connect(e,t);var r=e.lookupFunctions.valueConverters(this.name);if(!r)throw new Error('No ValueConverter named "'+this.name+'" was found!');var o=r.signals;if(void 0!==o)for(i=o.length;i--;)Jo(e,o[i])},t}(On),Nn=function(e){function t(t,n){var i;return(i=e.call(this)||this).target=t,i.value=n,i.isAssignable=!0,i}se(t,e);var n=t.prototype;return n.evaluate=function(e,t){return this.target.assign(e,this.value.evaluate(e,t))},n.accept=function(e){e.visitAssign(this)},n.connect=function(e,t){},n.assign=function(e,t){this.value.assign(e,t),this.target.assign(e,t)},t}(On),Tn=function(e){function t(t,n,i){var r;return(r=e.call(this)||this).condition=t,r.yes=n,r.no=i,r}se(t,e);var n=t.prototype;return n.evaluate=function(e,t){return this.condition.evaluate(e,t)?this.yes.evaluate(e,t):this.no.evaluate(e,t)},n.accept=function(e){return e.visitConditional(this)},n.connect=function(e,t){this.condition.connect(e,t),this.condition.evaluate(t)?this.yes.connect(e,t):this.no.connect(e,t)},t}(On),Vn=function(e){function t(t){var n;return(n=e.call(this)||this).ancestor=t,n}se(t,e);var n=t.prototype;return n.evaluate=function(e,t){for(var n=e.overrideContext,i=this.ancestor;i--&&n;)n=n.parentOverrideContext;return i<1&&n?n.bindingContext:void 0},n.accept=function(e){return e.visitAccessThis(this)},n.connect=function(e,t){},t}(On),Mn=function(e){function t(t,n){var i;return(i=e.call(this)||this).name=t,i.ancestor=n,i.isAssignable=!0,i}se(t,e);var n=t.prototype;return n.evaluate=function(e,t){return Tt(this.name,e,this.ancestor)[this.name]},n.assign=function(e,t){var n=Tt(this.name,e,this.ancestor);return n?n[this.name]=t:void 0},n.accept=function(e){return e.visitAccessScope(this)},n.connect=function(e,t){var n=Tt(this.name,t,this.ancestor);e.observeProperty(n,this.name)},t}(On),In=function(e){function t(t,n){var i;return(i=e.call(this)||this).object=t,i.name=n,i.isAssignable=!0,i}se(t,e);var n=t.prototype;return n.evaluate=function(e,t){var n=this.object.evaluate(e,t);return null==n?n:n[this.name]},n.assign=function(e,t){var n=this.object.evaluate(e);return null==n&&(n={},this.object.assign(e,n)),n[this.name]=t,t},n.accept=function(e){return e.visitAccessMember(this)},n.connect=function(e,t){this.object.connect(e,t);var n=this.object.evaluate(t);n&&e.observeProperty(n,this.name)},t}(On),Ln=function(e){function t(t,n){var i;return(i=e.call(this)||this).object=t,i.key=n,i.isAssignable=!0,i}se(t,e);var n=t.prototype;return n.evaluate=function(e,t){return function(e,t){if(Array.isArray(e))return e[parseInt(t,10)];if(e)return e[t];if(null==e)return;return e[t]}(this.object.evaluate(e,t),this.key.evaluate(e,t))},n.assign=function(e,t){return function(e,t,n){if(Array.isArray(e)){var i=parseInt(t,10);e.length<=i&&(e.length=i+1),e[i]=n}else e[t]=n;return n}(this.object.evaluate(e),this.key.evaluate(e),t)},n.accept=function(e){return e.visitAccessKeyed(this)},n.connect=function(e,t){this.object.connect(e,t);var n=this.object.evaluate(t);if(n instanceof Object){this.key.connect(e,t);var i=this.key.evaluate(t);null==i||Array.isArray(n)&&"number"==typeof i||e.observeProperty(n,i)}},t}(On),jn=function(e){function t(t,n,i){var r;return(r=e.call(this)||this).name=t,r.args=n,r.ancestor=i,r}se(t,e);var n=t.prototype;return n.evaluate=function(e,t,n){var i=$n(e,this.args,t),r=Tt(this.name,e,this.ancestor),o=Gn(r,this.name,n);if(o)return o.apply(r,i)},n.accept=function(e){return e.visitCallScope(this)},n.connect=function(e,t){for(var n=this.args,i=n.length;i--;)n[i].connect(e,t)},t}(On),Bn=function(e){function t(t,n,i){var r;return(r=e.call(this)||this).object=t,r.name=n,r.args=i,r}se(t,e);var n=t.prototype;return n.evaluate=function(e,t,n){var i=this.object.evaluate(e,t),r=$n(e,this.args,t),o=Gn(i,this.name,n);if(o)return o.apply(i,r)},n.accept=function(e){return e.visitCallMember(this)},n.connect=function(e,t){if(this.object.connect(e,t),Gn(this.object.evaluate(t),this.name,!1))for(var n=this.args,i=n.length;i--;)n[i].connect(e,t)},t}(On),Fn=function(e){function t(t,n){var i;return(i=e.call(this)||this).func=t,i.args=n,i}se(t,e);var n=t.prototype;return n.evaluate=function(e,t,n){var i=this.func.evaluate(e,t);if("function"==typeof i)return i.apply(null,$n(e,this.args,t));if(n||null!=i)throw new Error(this.func+" is not a function")},n.accept=function(e){return e.visitCallFunction(this)},n.connect=function(e,t){if(this.func.connect(e,t),"function"==typeof this.func.evaluate(t))for(var n=this.args,i=n.length;i--;)n[i].connect(e,t)},t}(On),qn=function(e){function t(t,n,i){var r;return(r=e.call(this)||this).operation=t,r.left=n,r.right=i,r}se(t,e);var n=t.prototype;return n.evaluate=function(e,t){var n=this.left.evaluate(e,t);switch(this.operation){case"&&":return n&&this.right.evaluate(e,t);case"||":return n||this.right.evaluate(e,t)}var i=this.right.evaluate(e,t);switch(this.operation){case"==":return n==i;case"===":return n===i;case"!=":return n!=i;case"!==":return n!==i;case"instanceof":return"function"==typeof i&&n instanceof i;case"in":return"object"==typeof i&&null!==i&&n in i}if(null===n||null===i||void 0===n||void 0===i){switch(this.operation){case"+":return null!=n?n:null!=i?i:0;case"-":return null!=n?n:null!=i?0-i:0}return null}switch(this.operation){case"+":return function(e,t){if(null!==e&&null!==t)return"string"==typeof e&&"string"!=typeof t?e+t.toString():"string"!=typeof e&&"string"==typeof t?e.toString()+t:e+t;if(null!==e)return e;if(null!==t)return t;return 0}(n,i);case"-":return n-i;case"*":return n*i;case"/":return n/i;case"%":return n%i;case"<":return n":return n>i;case"<=":return n<=i;case">=":return n>=i;case"^":return n^i}throw new Error("Internal error ["+this.operation+"] not handled")},n.accept=function(e){return e.visitBinary(this)},n.connect=function(e,t){this.left.connect(e,t);var n=this.left.evaluate(t);"&&"===this.operation&&!n||"||"===this.operation&&n||this.right.connect(e,t)},t}(On),Dn=function(e){function t(t,n){var i;return(i=e.call(this)||this).operation=t,i.expression=n,i}se(t,e);var n=t.prototype;return n.evaluate=function(e,t){switch(this.operation){case"!":return!this.expression.evaluate(e,t);case"typeof":return typeof this.expression.evaluate(e,t);case"void":return void this.expression.evaluate(e,t)}throw new Error("Internal error ["+this.operation+"] not handled")},n.accept=function(e){return e.visitPrefix(this)},n.connect=function(e,t){this.expression.connect(e,t)},t}(On),zn=function(e){function t(t){var n;return(n=e.call(this)||this).value=t,n}se(t,e);var n=t.prototype;return n.evaluate=function(e,t){return this.value},n.accept=function(e){return e.visitLiteralPrimitive(this)},n.connect=function(e,t){},t}(On),Hn=function(e){function t(t){var n;return(n=e.call(this)||this).value=t,n}se(t,e);var n=t.prototype;return n.evaluate=function(e,t){return this.value},n.accept=function(e){return e.visitLiteralString(this)},n.connect=function(e,t){},t}(On),Un=function(e){function t(t,n,i,r){var o;if((o=e.call(this)||this).cooked=t,o.expressions=n||[],o.length=o.expressions.length,o.tagged=void 0!==r,o.tagged)if(o.cooked.raw=i,o.tag=r,r instanceof Mn)o.contextType="Scope";else{if(!(r instanceof In||r instanceof Ln))throw new Error(o.tag+" is not a valid template tag");o.contextType="Object"}return o}se(t,e);var n=t.prototype;return n.getScopeContext=function(e,t){return Tt(this.tag.name,e,this.tag.ancestor)},n.getObjectContext=function(e,t){return this.tag.object.evaluate(e,t)},n.evaluate=function(e,t,n){for(var i=new Array(this.length),r=0;r=97&&this.write(" "),e.expression.accept(this),this.write(")")},n.visitBinary=function(e){e.left.accept(this),105===e.operation.charCodeAt(0)?this.write(" "+e.operation+" "):this.write(e.operation),e.right.accept(this)},n.visitLiteralPrimitive=function(e){this.write(""+e.value)},n.visitLiteralArray=function(e){var t=e.elements;this.write("[");for(var n=0,i=t.length;n=this.len?this.err("Unexpected end of expression"):this.err()}if(e&ai)return t;for(var c=this.val;this.tknξ)switch(this.tkn){case Ti:if(this.nextToken(),this.tkn&gi||this.err(),c=this.val,this.nextToken(),e=e&si|(e&(ti|ni))<<1|e&ii|(e&ri)>>1|(e&oi)>>2,this.tkn===Pi)continue;t=e&ni?new Mn(c,t.ancestor):new In(t,c);continue;case Li:this.nextToken(),e=ri,t=new Ln(t,this.parseExpression()),this.expect(ji);break;case Pi:this.nextToken();for(var l=[];this.tkn!==Mi&&(l.push(this.parseExpression()),this.opt(Ii)););this.expect(Mi),t=e&ni?new jn(c,l,t.ancestor):e&(ii|si)?new Bn(t,c,l):new Fn(t,l),e=oi;break;case ki:t=new Un([this.val],[],[this.raw],t),this.nextToken();break;case Ci:t=this.parseTemplate(e|ui,t)}return t},t.parseTemplate=function(e,t){var n=[this.val],i=e&ui?[this.raw]:void 0;this.expect(Ci);for(var r=[this.parseExpression()];(this.tkn=this.scanTemplateTail())!==ki;)n.push(this.val),e&ui&&i.push(this.raw),this.expect(Ci),r.push(this.parseExpression());return n.push(this.val),e&ui&&i.push(this.raw),this.nextToken(),new Un(n,r,i,t)},t.nextToken=function(){for(;this.idx=97&&this.ch<=122)return void(this.tkn=this.scanIdentifier());if(null!==(this.tkn=xr[this.ch](this)))return}this.tkn=pi},t.next=function(){return this.ch=this.src.charCodeAt(++this.idx)},t.scanIdentifier=function(){for(;br.has(this.next())||this.ch>127&&wr[this.ch];);return lr[this.val=this.raw]||vi},t.scanNumber=function(e){if(e)this.val=0;else for(this.val=this.ch-48;this.next()<=57&&this.ch>=48;)this.val=10*this.val+this.ch-48;if(e||46===this.ch){e||this.next();for(var t=this.idx,n=this.ch-48;this.next()<=57&&this.ch>=48;)n=10*n+this.ch-48;this.val=this.val+n/Math.pow(10,this.idx-t)}if(101===this.ch||69===this.ch){var i=this.idx;for(this.next(),45!==this.ch&&43!==this.ch||this.next(),this.ch>=48&&this.ch<=57||(this.idx=i,this.err("Invalid exponent"));this.next()<=57&&this.ch>=48;);this.val=parseFloat(this.src.slice(this.start,this.idx))}return yi},t.scanString=function(){var e,t=this.ch;this.next();for(var n=this.idx;this.ch!==t;)if(92===this.ch){e||(e=[]),e.push(this.src.slice(n,this.idx)),this.next();var i=void 0;if(117===this.ch)if(this.next(),this.idx+4=this.len?this.err("Unterminated quote"):this.next();var o=this.src.slice(n,this.idx);this.next();var s=o;return null!=e&&(e.push(o),s=e.join("")),this.val=s,bi},t.scanTemplate=function(){for(var e=!0,t="";96!==this.next();)if(36===this.ch){if(this.idx+1=this.len?this.err("Unterminated template literal"):t+=Jn(this.ch);return this.next(),this.val=t,e?ki:Ci},t.scanTemplateTail=function(){return this.idx>=this.len&&this.err("Unterminated template"),this.idx--,this.scanTemplate()},t.err=function(e,t){throw void 0===e&&(e="Unexpected token "+this.raw),void 0===t&&(t=this.start),new Error("Parser Error: "+e+" at column "+t+" in expression ["+this.src+"]")},t.opt=function(e){return this.tkn===e&&(this.nextToken(),!0)},t.expect=function(e){this.tkn===e?this.nextToken():this.err("Missing expected token "+hr[e&li],this.idx)},e}();function ei(e){switch(e){case 102:return 12;case 110:return 10;case 114:return 13;case 116:return 9;case 118:return 11;default:return e}}var ti=1024,ni=2048,ii=4096,ri=8192,oi=16384,si=32768,ai=65536,ui=1<<17,ci=511,li=63,hi=448,di=2048,fi=16384,pi=65536|fi|di,vi=1<<17,gi=32768|vi,mi=1<<18,yi=1<<19|mi,bi=1<<20|mi,wi=1<<21,xi=1<<24,ki=1<<25|xi,Ci=1<<26|xi,_i=32768|mi,Si=32769|mi,Ei=32770|mi,Ai=32771|mi,Oi=4|gi,Ri=5|gi,Pi=8198|fi|xi,Ni=8199,Ti=8388616|xi,Vi=4105|fi|di,Mi=4106|fi|di,Ii=11|fi,Li=8204|fi|1<<23|xi,ji=4109|di,Bi=14|fi,Fi=15,qi=18|fi,Di=19|fi,zi=84|wi,Hi=149|wi,Ui=214|wi,Wi=279|wi,Qi=280|wi,$i=281|wi,Gi=282|wi,Ki=347|wi,Xi=348|wi,Yi=349|wi,Ji=350|wi,Zi=33119|wi,er=33120|wi,tr=417|wi|1<<22,nr=418|wi|1<<22,ir=4227107,rr=4227108,or=485|wi,sr=486|wi,ar=487|wi,ur=40,cr=4194345,lr=Object.create(null);lr.true=Si,lr.null=Ei,lr.false=_i,lr.undefined=Ai,lr.$this=Oi,lr.$parent=Ri,lr.in=Zi,lr.instanceof=er,lr.typeof=ir,lr.void=rr;var hr=[!1,!0,null,void 0,"$this","$parent","(","{",".","}",")",",","[","]",":","?","'",'"',"&","|","||","&&","^","==","!=","===","!==","<",">","<=",">=","in","instanceof","+","-","typeof","void","*","%","/","=","!"],dr=[36,0,48,58,65,91,95,0,97,123],fr=[36,0,65,91,95,0,97,123,170,0,186,0,192,215,216,247,248,697,736,741,7424,7462,7468,7517,7522,7526,7531,7544,7545,7615,7680,7936,8305,0,8319,0,8336,8349,8490,8492,8498,0,8526,0,8544,8585,11360,11392,42786,42888,42891,42927,42928,42936,42999,43008,43824,43867,43868,43877,64256,64263,65313,65339,65345,65371],pr=[48,58],vr=[0,33,127,161];function gr(e,t,n,i){for(var r=n.length,o=0;o0?a:s+1,e)for(var u=s;u=48?e.scanNumber(!0):Ti},xr[60]=function(e){return 61!==e.next()?Ki:(e.next(),Yi)},xr[62]=function(e){return 61!==e.next()?Xi:(e.next(),Ji)},xr[37]=mr(sr),xr[40]=mr(Pi),xr[41]=mr(Mi),xr[42]=mr(or),xr[43]=mr(tr),xr[44]=mr(Ii),xr[45]=mr(nr),xr[47]=mr(ar),xr[58]=mr(Bi),xr[63]=mr(Fi),xr[91]=mr(Li),xr[93]=mr(ji),xr[94]=mr(Ui),xr[123]=mr(Ni),xr[125]=mr(Vi);var Cr=Map.prototype;function _r(e,t){return Sr.for(e,t)}var Sr=function(e){function t(t,n){return e.call(this,t,n)||this}return se(t,e),t.for=function(e,n){return"__map_observer__"in n||Reflect.defineProperty(n,"__map_observer__",{value:t.create(e,n),enumerable:!1,configurable:!1}),n.__map_observer__},t.create=function(e,n){var i=new t(e,n),r=Cr;return r.set===n.set&&r.delete===n.delete&&r.clear===n.clear||(r={set:n.set,delete:n.delete,clear:n.clear}),n.set=function(){var e=n.has(arguments[0]),t=e?"update":"add",o=n.get(arguments[0]),s=r.set.apply(n,arguments);return e&&o===n.get(arguments[0])||i.addChangeRecord({type:t,object:n,key:arguments[0],oldValue:o}),s},n.delete=function(){var e=n.has(arguments[0]),t=n.get(arguments[0]),o=r.delete.apply(n,arguments);return e&&i.addChangeRecord({type:"delete",object:n,key:arguments[0],oldValue:t}),o},n.clear=function(){var e=r.clear.apply(n,arguments);return i.addChangeRecord({type:"clear",object:n}),e},i},t}(gn);function Er(e){return e.path&&e.path[0]||e.deepPath&&e.deepPath[0]||e.target}function Ar(){this.standardStopPropagation(),this.propagationStopped=!0}function Or(e){e.propagationStopped=!1;for(var t=Er(e),n=[];t;){if(t.capturedCallbacks){var i=t.capturedCallbacks[e.type];i&&(e.stopPropagation!==Ar&&(e.standardStopPropagation=e.stopPropagation,e.stopPropagation=Ar),n.push(i))}t=t.parentNode}for(var r=n.length-1;r>=0&&!e.propagationStopped;r--){var o=n[r];"handleEvent"in o?o.handleEvent(e):o(e)}}var Rr=function(){function e(e){this.eventName=e,this.count=0}var t=e.prototype;return t.increment=function(){this.count++,1===this.count&&r.addEventListener(this.eventName,Or,!0)},t.decrement=function(){this.count--,0===this.count&&r.removeEventListener(this.eventName,Or,!0)},e}();function Pr(e){e.propagationStopped=!1;for(var t=Er(e);t&&!e.propagationStopped;){if(t.delegatedCallbacks){var n=t.delegatedCallbacks[e.type];n&&(e.stopPropagation!==Ar&&(e.standardStopPropagation=e.stopPropagation,e.stopPropagation=Ar),"handleEvent"in n?n.handleEvent(e):n(e))}t=t.parentNode}}var Nr=function(){function e(e){this.eventName=e,this.count=0}var t=e.prototype;return t.increment=function(){this.count++,1===this.count&&r.addEventListener(this.eventName,Pr,!1)},t.decrement=function(){this.count--,0===this.count&&r.removeEventListener(this.eventName,Pr,!1)},e}(),Tr=function(){function e(e,t,n){this.entry=e,this.lookup=t,this.targetEvent=n}return e.prototype.dispose=function(){this.entry.decrement(),this.lookup[this.targetEvent]=null},e}(),Vr=function(){function e(e,t,n){this.target=e,this.targetEvent=t,this.callback=n}return e.prototype.dispose=function(){this.target.removeEventListener(this.targetEvent,this.callback)},e}(),Mr=function(){function e(){this.delegatedHandlers={},this.capturedHandlers={}}return e.prototype.subscribe=function(e,t,n,i,r){var o,s,a;if(i===Ir.bubbling){o=this.delegatedHandlers,a=o[t]||(o[t]=new Nr(t));var u=e.delegatedCallbacks||(e.delegatedCallbacks={});return a.increment(),u[t]=n,!0===r?new Tr(a,u,t):function(){a.decrement(),u[t]=null}}if(i===Ir.capturing){s=this.capturedHandlers,a=s[t]||(s[t]=new Rr(t));var c=e.capturedCallbacks||(e.capturedCallbacks={});return a.increment(),c[t]=n,!0===r?new Tr(a,c,t):function(){a.decrement(),c[t]=null}}return e.addEventListener(t,n),!0===r?new Vr(e,t,n):function(){e.removeEventListener(t,n)}},e}(),Ir={none:0,capturing:1,bubbling:2},Lr=function(){function e(){this.elementHandlerLookup={},this.eventStrategyLookup={},this.registerElementConfig({tagName:"input",properties:{value:["change","input"],checked:["change","input"],files:["change","input"]}}),this.registerElementConfig({tagName:"textarea",properties:{value:["change","input"]}}),this.registerElementConfig({tagName:"select",properties:{value:["change"]}}),this.registerElementConfig({tagName:"content editable",properties:{value:["change","input","blur","keyup","paste"]}}),this.registerElementConfig({tagName:"scrollable element",properties:{scrollTop:["scroll"],scrollLeft:["scroll"]}}),this.defaultEventStrategy=new Mr}var t=e.prototype;return t.registerElementConfig=function(e){var t,n=e.tagName.toLowerCase(),i=e.properties,r=this.elementHandlerLookup[n]={};for(t in i)i.hasOwnProperty(t)&&(r[t]=i[t])},t.registerEventStrategy=function(e,t){this.eventStrategyLookup[e]=t},t.getElementHandler=function(e,t){var n,i=this.elementHandlerLookup;if(e.tagName){if(i[n=e.tagName.toLowerCase()]&&i[n][t])return new jr(i[n][t]);if("textContent"===t||"innerHTML"===t)return new jr(i["content editable"].value);if("scrollTop"===t||"scrollLeft"===t)return new jr(i["scrollable element"][t])}return null},t.addEventListener=function(e,t,n,i,r){return(this.eventStrategyLookup[t]||this.defaultEventStrategy).subscribe(e,t,n,i,r)},e}(),jr=function(){function e(e){this.events=e,this.element=null,this.handler=null}var t=e.prototype;return t.subscribe=function(e,t){this.element=e,this.handler=t;for(var n=this.events,i=0,r=n.length;r>i;++i)e.addEventListener(n[i],t)},t.dispose=function(){if(null!==this.element){for(var e=this.element,t=this.handler,n=this.events,i=0,r=n.length;r>i;++i)e.removeEventListener(n[i],t);this.element=this.handler=null}},e}(),Br=function(){function e(){this.tracked=[],this.checkDelay=120}var t=e.prototype;return t.addProperty=function(e){var t=this.tracked;t.push(e),1===t.length&&this.scheduleDirtyCheck()},t.removeProperty=function(e){var t=this.tracked;t.splice(t.indexOf(e),1)},t.scheduleDirtyCheck=function(){var e=this;setTimeout(function(){return e.check()},this.checkDelay)},t.check=function(){for(var e=this.tracked,t=e.length;t--;){var n=e[t];n.isDirty()&&n.call()}e.length&&this.scheduleDirtyCheck()},e}(),Fr=sn()(gt=function(){function e(e,t,n){this.dirtyChecker=e,this.obj=t,this.propertyName=n}var t=e.prototype;return t.getValue=function(){return this.obj[this.propertyName]},t.setValue=function(e){this.obj[this.propertyName]=e},t.call=function(){var e=this.oldValue,t=this.getValue();this.callSubscribers(t,e),this.oldValue=t},t.isDirty=function(){return this.oldValue!==this.obj[this.propertyName]},t.subscribe=function(e,t){this.hasSubscribers()||(this.oldValue=this.getValue(),this.dirtyChecker.addProperty(this)),this.addSubscriber(e,t)},t.unsubscribe=function(e,t){this.removeSubscriber(e,t)&&!this.hasSubscribers()&&this.dirtyChecker.removeProperty(this)},e}())||gt,qr=Z("property-observation"),Dr={getValue:function(e,t){return e[t]},setValue:function(e,t,n){t[n]=e}},zr=function(){function e(e,t){this.doNotCache=!0,this.primitive=e,this.propertyName=t}var t=e.prototype;return t.getValue=function(){return this.primitive[this.propertyName]},t.setValue=function(){var e=typeof this.primitive;throw new Error("The "+this.propertyName+" property of a "+e+" ("+this.primitive+") cannot be assigned.")},t.subscribe=function(){},t.unsubscribe=function(){},e}(),Hr=sn()(mt=function(){function e(e,t,n){this.taskQueue=e,this.obj=t,this.propertyName=n,this.queued=!1,this.observing=!1}var t=e.prototype;return t.getValue=function(){return this.obj[this.propertyName]},t.setValue=function(e){this.obj[this.propertyName]=e},t.getterValue=function(){return this.currentValue},t.setterValue=function(e){var t=this.currentValue;t!==e&&(this.queued||(this.oldValue=t,this.queued=!0,this.taskQueue.queueMicroTask(this)),this.currentValue=e)},t.call=function(){var e=this.oldValue,t=this.currentValue;this.queued=!1,this.callSubscribers(t,e)},t.subscribe=function(e,t){this.observing||this.convertProperty(),this.addSubscriber(e,t)},t.unsubscribe=function(e,t){this.removeSubscriber(e,t)},t.convertProperty=function(){this.observing=!0,this.currentValue=this.obj[this.propertyName],this.setValue=this.setterValue,this.getValue=this.getterValue,Reflect.defineProperty(this.obj,this.propertyName,{configurable:!0,enumerable:!(this.propertyName in this.obj)||this.obj.propertyIsEnumerable(this.propertyName),get:this.getValue.bind(this),set:this.setValue.bind(this)})||qr.warn("Cannot observe property '"+this.propertyName+"' of object",this.obj)},e}())||mt,Ur=function(){function e(e,t,n){this.element=e,this.propertyName=t,this.attributeName=n}var t=e.prototype;return t.getValue=function(){return this.element.getAttributeNS("http://www.w3.org/1999/xlink",this.attributeName)},t.setValue=function(e){return this.element.setAttributeNS("http://www.w3.org/1999/xlink",this.attributeName,e)},t.subscribe=function(){throw new Error('Observation of a "'+this.element.nodeName+'" element\'s "'+this.propertyName+'" property is not supported.')},e}(),Wr={getValue:function(e,t){return e.getAttribute(t)},setValue:function(e,t,n){null==e?t.removeAttribute(n):t.setAttribute(n,e)}},Qr=function(){function e(e,t){this.element=e,this.propertyName=t}var t=e.prototype;return t.getValue=function(){return this.element.getAttribute(this.propertyName)},t.setValue=function(e){return null==e?this.element.removeAttribute(this.propertyName):this.element.setAttribute(this.propertyName,e)},t.subscribe=function(){throw new Error('Observation of a "'+this.element.nodeName+'" element\'s "'+this.propertyName+'" property is not supported.')},e}(),$r=function(){function e(e,t){this.element=e,this.propertyName=t,this.styles=null,this.version=0}var t=e.prototype;return t.getValue=function(){return this.element.style.cssText},t._setProperty=function(e,t){var n="";null!=t&&"function"==typeof t.indexOf&&-1!==t.indexOf("!important")&&(n="important",t=t.replace("!important","")),this.element.style.setProperty(e,t,n)},t.setValue=function(e){var t,n,i=this.styles||{},r=this.version;if(null!=e)if(e instanceof Object)for(t in e)e.hasOwnProperty(t)&&(n=e[t],i[t=t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})]=r,this._setProperty(t,n));else if(e.length)for(var o,s=/\s*([\w\-]+)\s*:\s*((?:(?:[\w\-]+\(\s*(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[\w\-]+\(\s*(?:^"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^\)]*)\),?|[^\)]*)\),?|"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^;]*),?\s*)+);?/g;null!==(o=s.exec(e));)(t=o[1])&&(i[t]=r,this._setProperty(t,o[2]));if(this.styles=i,this.version+=1,0!==r)for(t in r-=1,i)i.hasOwnProperty(t)&&i[t]===r&&this.element.style.removeProperty(t)},t.subscribe=function(){throw new Error('Observation of a "'+this.element.nodeName+'" element\'s "'+this.propertyName+'" property is not supported.')},e}(),Gr=sn()(yt=function(){function e(e,t,n){this.element=e,this.propertyName=t,this.handler=n,"files"===t&&(this.setValue=function(){})}var t=e.prototype;return t.getValue=function(){return this.element[this.propertyName]},t.setValue=function(e){e=null==e?"":e,this.element[this.propertyName]!==e&&(this.element[this.propertyName]=e,this.notify())},t.notify=function(){var e=this.oldValue,t=this.getValue();this.callSubscribers(t,e),this.oldValue=t},t.handleEvent=function(){this.notify()},t.subscribe=function(e,t){this.hasSubscribers()||(this.oldValue=this.getValue(),this.handler.subscribe(this.element,this)),this.addSubscriber(e,t)},t.unsubscribe=function(e,t){this.removeSubscriber(e,t)&&!this.hasSubscribers()&&this.handler.dispose()},e}())||yt,Kr=sn()(bt=function(){function e(e,t,n){this.element=e,this.handler=t,this.observerLocator=n}var t=e.prototype;return t.getValue=function(){return this.value},t.setValue=function(e){this.initialSync&&this.value===e||(this.arrayObserver&&(this.arrayObserver.unsubscribe("CheckedObserver:array",this),this.arrayObserver=null),"checkbox"===this.element.type&&Array.isArray(e)&&(this.arrayObserver=this.observerLocator.getArrayObserver(e),this.arrayObserver.subscribe("CheckedObserver:array",this)),this.oldValue=this.value,this.value=e,this.synchronizeElement(),this.notify(),this.initialSync||(this.initialSync=!0,this.observerLocator.taskQueue.queueMicroTask(this)))},t.call=function(e,t){this.synchronizeElement(),this.valueObserver||(this.valueObserver=this.element.__observers__.model||this.element.__observers__.value,this.valueObserver&&this.valueObserver.subscribe("CheckedObserver:value",this))},t.synchronizeElement=function(){var e=this.value,t=this.element,n=t.hasOwnProperty("model")?t.model:t.value,i="radio"===t.type,r=t.matcher||function(e,t){return e===t};t.checked=i&&!!r(e,n)||!i&&!0===e||!i&&Array.isArray(e)&&-1!==e.findIndex(function(e){return!!r(e,n)})},t.synchronizeValue=function(){var e,t=this.value,n=this.element,i=n.hasOwnProperty("model")?n.model:n.value,r=n.matcher||function(e,t){return e===t};if("checkbox"===n.type){if(Array.isArray(t))return e=t.findIndex(function(e){return!!r(e,i)}),void(n.checked&&-1===e?t.push(i):n.checked||-1===e||t.splice(e,1));t=n.checked}else{if(!n.checked)return;t=i}this.oldValue=this.value,this.value=t,this.notify()},t.notify=function(){var e=this.oldValue,t=this.value;t!==e&&this.callSubscribers(t,e)},t.handleEvent=function(){this.synchronizeValue()},t.subscribe=function(e,t){this.hasSubscribers()||this.handler.subscribe(this.element,this),this.addSubscriber(e,t)},t.unsubscribe=function(e,t){this.removeSubscriber(e,t)&&!this.hasSubscribers()&&this.handler.dispose()},t.unbind=function(){this.arrayObserver&&(this.arrayObserver.unsubscribe("CheckedObserver:array",this),this.arrayObserver=null),this.valueObserver&&this.valueObserver.unsubscribe("CheckedObserver:value",this)},e}())||bt,Xr=sn()(wt=function(){function e(e,t,n){this.element=e,this.handler=t,this.observerLocator=n}var t=e.prototype;return t.getValue=function(){return this.value},t.setValue=function(e){if(null!=e&&this.element.multiple&&!Array.isArray(e))throw new Error("Only null or Array instances can be bound to a multi-select.");this.value!==e&&(this.arrayObserver&&(this.arrayObserver.unsubscribe("SelectValueObserver:array",this),this.arrayObserver=null),Array.isArray(e)&&(this.arrayObserver=this.observerLocator.getArrayObserver(e),this.arrayObserver.subscribe("SelectValueObserver:array",this)),this.oldValue=this.value,this.value=e,this.synchronizeOptions(),this.notify(),this.initialSync||(this.initialSync=!0,this.observerLocator.taskQueue.queueMicroTask(this)))},t.call=function(e,t){this.synchronizeOptions()},t.synchronizeOptions=function(){var e,t=this.value;Array.isArray(t)&&(e=!0);for(var n=this.element.options,i=n.length,r=this.element.matcher||function(e,t){return e===t},o=function(){var o=n.item(i),s=o.hasOwnProperty("model")?o.model:o.value;if(e)return o.selected=-1!==t.findIndex(function(e){return!!r(s,e)}),"continue";o.selected=!!r(s,t)};i--;)o()},t.synchronizeValue=function(){for(var e=this,t=this.element.options,n=0,i=[],r=0,o=t.length;r").firstElementChild.nodeName&&so.altGlyph&&(so.altglyph=so.altGlyph,delete so.altGlyph,so.altglyphdef=so.altGlyphDef,delete so.altGlyphDef,so.altglyphitem=so.altGlyphItem,delete so.altGlyphItem,so.glyphref=so.glyphRef,delete so.glyphRef)}return e.prototype.isStandardSvgAttribute=function(e,t){return ao[e]&&uo[t]||so[e]&&-1!==so[e].indexOf(t)},e}()}var so=Zr,ao=eo,uo=to,co=no||function(){function e(){}return e.prototype.isStandardSvgAttribute=function(){return!1},e}(),lo=(kt=xt=function(){function e(e,t,n,i,r){this.taskQueue=e,this.eventManager=t,this.dirtyChecker=n,this.svgAnalyzer=i,this.parser=r,this.adapters=[],this.logger=Z("observer-locator")}var t=e.prototype;return t.getObserver=function(e,t){var n,i=e.__observers__;return i&&t in i?i[t]:((n=this.createPropertyObserver(e,t)).doNotCache||(void 0===i&&(i=this.getOrCreateObserversLookup(e)),i[t]=n),n)},t.getOrCreateObserversLookup=function(e){return e.__observers__||this.createObserversLookup(e)},t.createObserversLookup=function(e){var t={};return Reflect.defineProperty(e,"__observers__",{enumerable:!1,configurable:!1,writable:!1,value:t})||this.logger.warn("Cannot add observers to object",e),t},t.addAdapter=function(e){this.adapters.push(e)},t.getAdapterObserver=function(e,t,n){for(var i=0,r=this.adapters.length;i-1&&n.splice(t,1),e},t.publish=function(e,t,n,i){void 0===t&&(t={}),void 0===n&&(n=!0),void 0===i&&(i=!0);var o=r.createCustomEvent(e,{cancelable:i,bubbles:n,detail:t});this.element.dispatchEvent(o)},t.subscribe=function(e,t,n){if(void 0===n&&(n=!0),"function"==typeof t)return new cs(this,e,t,n,!1)},t.subscribeOnce=function(e,t,n){if(void 0===n&&(n=!0),"function"==typeof t)return new cs(this,e,t,n,!0)},t.dispose=function(e){if(e&&"string"==typeof e){var t=this.subscriptions[e];if(t)for(;t.length;){var n=t.pop();n&&n.dispose()}}else this.disposeAll()},t.disposeAll=function(){for(var e in this.subscriptions)this.dispose(e)},e}(),cs=function(){function e(e,t,n,i,r){this.owner=e,this.eventName=t,this.handler=n,this.capture="boolean"==typeof i?i:i.capture,this.bubbles=!this.capture,this.captureOrOptions=i,this.once=r,e.element.addEventListener(t,this,i),e._enqueueHandler(this)}var t=e.prototype;return t.handleEvent=function(e){(0,this.handler)(e),this.once&&this.dispose()},t.dispose=function(){this.owner.element.removeEventListener(this.eventName,this,this.captureOrOptions),this.owner._dequeueHandler(this),this.owner=this.handler=null},e}(),ls=function(){function e(){this.dependencies={}}var t=e.prototype;return t.addDependency=function(e){this.dependencies[e]=!0},t.hasDependency=function(e){return e in this.dependencies},e}(),hs=function(e,t){void 0===e&&(e=!1),void 0===t&&(t=!1),this.targetShadowDOM=e,this.compileSurrogate=t,this.associatedModuleId=null};hs.normal=new hs;var ds=function(){function e(){}return e.enhance=function(){var t=new e;return t.enhance=!0,t},e.unitTest=function(t,n){var i=new e;return i.type=t,i.attributes=n||{},i},e.element=function(t,n){var i=new e;return i.type=n,i.attributes={},i.anchorIsContainer=!(t.hasAttribute("containerless")||n.containerless),i.initiatedByBehavior=!0,i},e.attribute=function(t,n){var i=new e;return i.attrName=t,i.type=n||null,i.attributes={},i},e.dynamic=function(t,n,i){var r=new e;return r.host=t,r.viewModel=n,r.viewFactory=i,r.inheritBindingContext=!0,r},e}(),fs=ds.prototype;fs.initiatedByBehavior=!1,fs.enhance=!1,fs.partReplacements=null,fs.viewFactory=null,fs.originalAttrName=null,fs.skipContentProcessing=!1,fs.contentFactory=null,fs.viewModel=null,fs.anchorIsContainer=!1,fs.host=null,fs.attributes=null,fs.type=null,fs.attrName=null,fs.inheritBindingContext=!1,ds.normal=new ds;var ps=(To=No=function(){function e(){}return e.shadowSlot=function(t){var n=new e;return n.parentInjectorId=t,n.shadowSlot=!0,n},e.contentExpression=function(t){var n=new e;return n.contentExpression=t,n},e.letElement=function(t){var n=new e;return n.expressions=t,n.letElement=!0,n},e.lifting=function(t,n){var i=new e;return i.parentInjectorId=t,i.expressions=e.noExpressions,i.behaviorInstructions=[n],i.viewFactory=n.viewFactory,i.providers=[n.type.target],i.lifting=!0,i},e.normal=function(t,n,i,r,o,s){var a=new e;return a.injectorId=t,a.parentInjectorId=n,a.providers=i,a.behaviorInstructions=r,a.expressions=o,a.anchorIsContainer=!s||s.anchorIsContainer,a.elementInstruction=s,a},e.surrogate=function(t,n,i,r){var o=new e;return o.expressions=i,o.behaviorInstructions=n,o.providers=t,o.values=r,o},e}(),No.noExpressions=Object.freeze([]),To),vs=ps.prototype;vs.injectorId=null,vs.parentInjectorId=null,vs.shadowSlot=!1,vs.slotName=null,vs.slotFallbackFactory=null,vs.contentExpression=null,vs.letElement=!1,vs.expressions=null,vs.expressions=null,vs.providers=null,vs.viewFactory=null,vs.anchorIsContainer=!1,vs.elementInstruction=null,vs.lifting=!1,vs.values=null;var gs=Pe.create("aurelia:view-strategy",{validate:function(e){return"function"==typeof e.loadViewFactory||"View strategies must implement: loadViewFactory(viewEngine: ViewEngine, compileInstruction: ViewCompileInstruction, loadContext?: ResourceLoadContext): Promise"},compose:function(e){"function"!=typeof e.makeRelativeTo&&(e.makeRelativeTo=i.noop)}}),ms=gs()(Vo=function(){function e(e){this.path=e,this.absolutePath=null}var t=e.prototype;return t.loadViewFactory=function(e,t,n,i){return null===this.absolutePath&&this.moduleId&&(this.absolutePath=et(this.path,this.moduleId)),t.associatedModuleId=this.moduleId,e.loadViewFactory(this.absolutePath||this.path,t,n,i)},t.makeRelativeTo=function(e){null===this.absolutePath&&(this.absolutePath=et(this.path,e))},e}())||Vo,ys=gs()(Mo=function(){function e(e,t){this.moduleId=t.moduleId,this.viewUrl=e.convertOriginToViewUrl(t)}return e.prototype.loadViewFactory=function(e,t,n,i){return t.associatedModuleId=this.moduleId,e.loadViewFactory(this.viewUrl,t,n,i)},e}())||Mo,bs=gs()(Io=function(){function e(e,t){this.dependencies=e||null,this.dependencyBaseUrl=t||""}return e.prototype.loadViewFactory=function(e,t,n,i){var r=this.entry,o=this.dependencies;if(r&&r.factoryIsReady)return Promise.resolve(null);if(this.entry=r=new lt(this.moduleId||this.dependencyBaseUrl),r.dependencies=[],r.templateIsLoaded=!0,null!==o)for(var s=0,a=o.length;s=h.length)break;p=h[f++]}else{if((f=h.next()).done)break;p=f.value}var v=p;if("function"==typeof v)null!==(o=c.autoRegister(s,v)).elementName&&l.push(o);else{if(!v||"object"!=typeof v)throw new Error('dependency neither function nor object. Received: "'+typeof v+'"');for(var g in v){var m=v[g];"function"==typeof m&&null!==(o=c.autoRegister(s,m)).elementName&&l.push(o)}}}return Promise.all(l.map(function(e){return e.load(s,e.target)})).then(function(){var e=null!==r.template?u.compile(r.template,c,t):null;return r.factoryIsReady=!0,r.factory=e,e})})},e}())||Bo,Cs=(qo=Fo=function(){function e(){}var t=e.prototype;return t.getViewStrategy=function(t){if(!t)return null;if("object"==typeof t&&"getViewStrategy"in t){var n=Ce.get(t.constructor);return"string"==typeof(t=t.getViewStrategy())&&(t=new ms(t)),gs.assert(t),n.moduleId&&t.makeRelativeTo(n.moduleId),t}if("string"==typeof t&&(t=new ms(t)),gs.validate(t))return t;if("function"!=typeof t&&(t=t.constructor),"$view"in t){var i,r=t.$view;return i=null===(r="function"==typeof r?r.call(t):r)?new bs:r instanceof ks?r:new ks(r),we.define(e.viewStrategyMetadataKey,i,t),i}var o=Ce.get(t),s=we.get(e.viewStrategyMetadataKey,t);if(s)o.moduleId&&(s.moduleId=o.moduleId);else{if(!o.moduleId)throw new Error("Cannot determine default view strategy for object.",t);s=this.createFallbackViewStrategy(o)}return s},t.createFallbackViewStrategy=function(e){return new ys(this,e)},t.convertOriginToViewUrl=function(e){var t=e.moduleId;return(t.endsWith(".js")||t.endsWith(".ts")?t.substring(0,t.length-3):t)+".html"},e}(),Fo.viewStrategyMetadataKey="aurelia:view-strategy",qo);function _s(e){throw new Error("BindingLanguage must implement "+e+"().")}var Ss=function(){function e(){}var t=e.prototype;return t.inspectAttribute=function(e,t,n,i){_s("inspectAttribute")},t.createAttributeInstruction=function(e,t,n,i){_s("createAttributeInstruction")},t.createLetExpressions=function(e,t){_s("createLetExpressions")},t.inspectTextContent=function(e,t){_s("inspectTextContent")},e}(),Es=Object.freeze([]),As=function(){function e(e){this.element=e,this.element.auSlotAttribute=this}return e.inject=function(){return[r.Element]},e.prototype.valueChanged=function(e,t){},e}(),Os=function(){function e(e,t,n,i){this.anchor=e,this.anchor.viewSlot=this,this.name=t,this.destinationName=n,this.fallbackFactory=i,this.destinationSlot=null,this.projections=0,this.contentView=null,new As(this.anchor).value=this.destinationName}var t=e.prototype;return t.renderFallbackContent=function(e,t,n,i){if(null===this.contentView){this.contentView=this.fallbackFactory.create(this.ownerView.container),this.contentView.bind(this.ownerView.bindingContext,this.ownerView.overrideContext);var r=Object.create(null);r[this.destinationSlot.name]=this.destinationSlot,Ps.distributeView(this.contentView,r,n,i,this.destinationSlot.name)}},t.passThroughTo=function(e){this.destinationSlot=e},t.addNode=function(t,n,i,r){null!==this.contentView&&(this.contentView.removeNodes(),this.contentView.detached(),this.contentView.unbind(),this.contentView=null),n.viewSlot instanceof e?n.viewSlot.passThroughTo(this):(this.projections++,this.destinationSlot.addNode(t,n,i,r))},t.removeView=function(e,t){this.projections--,this.destinationSlot.removeView(e,t),this.needsFallbackRendering&&this.renderFallbackContent(null,Es,t)},t.removeAll=function(e){this.projections=0,this.destinationSlot.removeAll(e),this.needsFallbackRendering&&this.renderFallbackContent(null,Es,e)},t.projectFrom=function(e,t){this.destinationSlot.projectFrom(e,t)},t.created=function(e){this.ownerView=e},t.bind=function(e){this.contentView&&this.contentView.bind(e.bindingContext,e.overrideContext)},t.attached=function(){this.contentView&&this.contentView.attached()},t.detached=function(){this.contentView&&this.contentView.detached()},t.unbind=function(){this.contentView&&this.contentView.unbind()},oe(e,[{key:"needsFallbackRendering",get:function(){return this.fallbackFactory&&0===this.projections}}]),e}(),Rs=function(){function e(e,t,n){this.anchor=e,this.anchor.isContentProjectionSource=!0,this.anchor.viewSlot=this,this.name=t,this.fallbackFactory=n,this.contentView=null,this.projections=0,this.children=[],this.projectFromAnchors=null,this.destinationSlots=null}var t=e.prototype;return t.addNode=function(e,t,n,i,r){if(null!==this.contentView&&(this.contentView.removeNodes(),this.contentView.detached(),this.contentView.unbind(),this.contentView=null),t.viewSlot instanceof Os)t.viewSlot.passThroughTo(this);else if(null!==this.destinationSlots)Ps.distributeNodes(e,[t],this.destinationSlots,this,i);else{t.auOwnerView=e,t.auProjectionSource=n,t.auAssignedSlot=this;var o=this._findAnchor(e,t,n,i);o.parentNode.insertBefore(t,o),this.children.push(t),this.projections++}},t.removeView=function(e,t){if(null!==this.destinationSlots)Ps.undistributeView(e,this.destinationSlots,this);else if(this.contentView&&this.contentView.hasSlots)Ps.undistributeView(e,this.contentView.slots,t);else{var n=this.children.find(function(e){return e.auSlotProjectFrom===t});if(n){for(var i=n.auProjectionChildren,r=0,o=i.length;r=i&&o!==e))return s.splice(u,0,t),l}return r.auProjectionChildren.push(t),r}}return this.anchor},t.projectTo=function(e){this.destinationSlots=e},t.projectFrom=function(e,t){var n=r.createComment("anchor"),i=this.anchor.parentNode;n.auSlotProjectFrom=t,n.auOwnerView=e,n.auProjectionChildren=[],i.insertBefore(n,this.anchor),this.children.push(n),null===this.projectFromAnchors&&(this.projectFromAnchors=[]),this.projectFromAnchors.push(n)},t.renderFallbackContent=function(e,t,n,i){if(null===this.contentView&&(this.contentView=this.fallbackFactory.create(this.ownerView.container),this.contentView.bind(this.ownerView.bindingContext,this.ownerView.overrideContext),this.contentView.insertNodesBefore(this.anchor)),this.contentView.hasSlots){var r=this.contentView.slots,o=this.projectFromAnchors;if(null!==o)for(var s in r)for(var a=r[s],u=0,c=o.length;uu;++u){var l=s[u];if(!l||"string"!=typeof l&&!l.name)throw new Error('Invalid bindable property at "'+u+'" for class "'+e.name+'". Expected either a string or an object with "name" property.');for(var h=new aa(l),d=!1,f=0,p=a.length;p>f;++f)if(a[f].name===h.name){d=!0;break}d||h.registerWith(e,n)}}}return n};var t=e.prototype;return t._tryAddHook=function(e,t){if("function"==typeof e[t]){for(var n,i=e[t].bind(e),r=1;void 0!==this[n=t+r.toString()];)r++;this[t]=!0,this[n]=i}},t._invokeHook=function(e,t,n,i,r){if(this.hasParent&&this.parent._invokeHook(e,t,n,i,r),this[e]){this[e+"1"](t,n,i,r);var o=e+"2";if(this[o]&&(this[o](t,n,i,r),this[o=e+"3"])){this[o](t,n,i,r);for(var s=4;void 0!==this[o=e+s.toString()];)this[o](t,n,i,r),s++}}},t.registerViewEngineHooks=function(e){this._tryAddHook(e,"beforeCompile"),this._tryAddHook(e,"afterCompile"),this._tryAddHook(e,"beforeCreate"),this._tryAddHook(e,"afterCreate"),this._tryAddHook(e,"beforeBind"),this._tryAddHook(e,"beforeUnbind")},t.getBindingLanguage=function(e){return this.bindingLanguage||(this.bindingLanguage=e)},t.patchInParent=function(e){var t=this.parent;this.parent=e||null,this.hasParent=null!==this.parent,null===e.parent&&(e.parent=t,e.hasParent=null!==t)},t.relativeToView=function(e){return et(e,this.viewUrl)},t.registerElement=function(e,t){Ns(this.elements,e,t,"an Element")},t.getElement=function(e){return this.elements[e]||(this.hasParent?this.parent.getElement(e):null)},t.mapAttribute=function(e){return this.attributeMap[e]||(this.hasParent?this.parent.mapAttribute(e):null)},t.registerAttribute=function(e,t,n){this.attributeMap[e]=n,Ns(this.attributes,e,t,"an Attribute")},t.getAttribute=function(e){return this.attributes[e]||(this.hasParent?this.parent.getAttribute(e):null)},t.registerValueConverter=function(e,t){Ns(this.valueConverters,e,t,"a ValueConverter")},t.getValueConverter=function(e){return this.valueConverters[e]||(this.hasParent?this.parent.getValueConverter(e):null)},t.registerBindingBehavior=function(e,t){Ns(this.bindingBehaviors,e,t,"a BindingBehavior")},t.getBindingBehavior=function(e){return this.bindingBehaviors[e]||(this.hasParent?this.parent.getBindingBehavior(e):null)},t.registerValue=function(e,t){Ns(this.values,e,t,"a value")},t.getValue=function(e){return this.values[e]||(this.hasParent?this.parent.getValue(e):null)},t.autoRegister=function(t,n){var i=we.getOwn(we.resource,n);return i?i instanceof ha&&(e.convention(n,i),null===i.attributeName&&null===i.elementName&&ha.convention(n.name,i),null===i.attributeName&&null===i.elementName&&(i.elementName=os(n.name))):((i=e.convention(n)||ha.convention(n.name)||mo.convention(n.name)||bo.convention(n.name)||as.convention(n.name))||((i=new ha).elementName=os(n.name)),we.define(we.resource,i,n)),i.initialize(t,n),i.register(this),i},e}(),Ms=function(){function e(e,t,n,i,r,o,s){for(var a in this.container=e,this.viewFactory=t,this.resources=t.resources,this.fragment=n,this.firstChild=n.firstChild,this.lastChild=n.lastChild,this.controllers=i,this.bindings=r,this.children=o,this.slots=s,this.hasSlots=!1,this.fromCache=!1,this.isBound=!1,this.isAttached=!1,this.bindingContext=null,this.overrideContext=null,this.controller=null,this.viewModelScope=null,this.animatableElement=void 0,this._isUserControlled=!1,this.contentView=null,s){this.hasSlots=!0;break}}var t=e.prototype;return t.returnToCache=function(){this.viewFactory.returnViewToCache(this)},t.created=function(){var e,t,n=this.controllers;for(e=0,t=n.length;e=i?this.add(t):(t.insertNodesBefore(n[e].firstChild),n.splice(e,0,t),this.isAttached?(t.attached(),this.animateView(t,"enter")):void 0)},t.move=function(e,t){if(e!==t){var n=this.children,i=n[e];i.removeNodes(),i.insertNodesBefore(n[t].firstChild),n.splice(e,1),n.splice(t,0,i)}},t.remove=function(e,t,n){return this.removeAt(this.children.indexOf(e),t,n)},t.removeMany=function(e,t,n){var i,r=this,o=this.children,s=e.length,a=[];e.forEach(function(e){if(n)e.removeNodes();else{var t=r.animateView(e,"leave");t?a.push(t.then(function(){return e.removeNodes()})):e.removeNodes()}});var u=function(){if(r.isAttached)for(i=0;i=0&&o.splice(n,1)}};return a.length>0?Promise.all(a).then(function(){return u()}):u()},t.removeAt=function(e,t,n){var i=this,r=this.children[e],o=function(){return e=i.children.indexOf(r),r.removeNodes(),i.children.splice(e,1),i.isAttached&&r.detached(),t&&r.returnToCache(),r};if(!n){var s=this.animateView(r,"leave");if(s)return s.then(function(){return o()})}return o()},t.removeAll=function(e,t){var n,i=this,r=this.children,o=r.length,s=[];r.forEach(function(e){if(t)e.removeNodes();else{var n=i.animateView(e,"leave");n?s.push(n.then(function(){return e.removeNodes()})):e.removeNodes()}});var a=function(){if(i.isAttached)for(n=0;n0?Promise.all(s).then(function(){return a()}):a()},t.attached=function(){var e,t,n,i;if(!this.isAttached)for(this.isAttached=!0,e=0,t=(n=this.children).length;e=this.children.length?this.add(t):(Ps.distributeView(t,this.projectToSlots,this,e),this.children.splice(e,0,t),this.isAttached&&t.attached())},t._projectionMove=function(e,t){if(e!==t){var n=this.children,i=n[e];Ps.undistributeView(i,this.projectToSlots,this),Ps.distributeView(i,this.projectToSlots,this,t),n.splice(e,1),n.splice(t,0,i)}},t._projectionRemove=function(e,t){Ps.undistributeView(e,this.projectToSlots,this),this.children.splice(this.children.indexOf(e),1),this.isAttached&&e.detached(),t&&e.returnToCache()},t._projectionRemoveAt=function(e,t){var n=this.children[e];Ps.undistributeView(n,this.projectToSlots,this),this.children.splice(e,1),this.isAttached&&n.detached(),t&&n.returnToCache()},t._projectionRemoveMany=function(e,t){var n=this;e.forEach(function(e){return n.remove(e,t)})},t._projectionRemoveAll=function(e){Ps.undistributeAll(this.projectToSlots,this);for(var t=this.children,n=t.length,i=0;i0?this.cache=[]:this.cache=null,this.isCaching=this.cacheSize>0},t.getCachedView=function(){return null!==this.cache&&this.cache.pop()||null},t.returnViewToCache=function(e){e.isAttached&&e.detached(),e.isBound&&e.unbind(),null!==this.cache&&this.cache.length0)return t[0].split(".")[1]}function Da(e){if(e.processed)throw new Error("This config instance has already been applied. To load more plugins or global resources, create a new FrameworkConfiguration instance.")}function za(e,t){return"Invalid "+t+" ["+e+"], "+t+" must be specified as functions or relative module IDs."}var Ha,Ua,Wa,Qa,$a,Ga,Ka,Xa,Ya=function(){function e(e){var t=this;this.aurelia=e,this.container=e.container,this.info=[],this.processed=!1,this.preTasks=[],this.postTasks=[],this.behaviorsToLoad=[],this.configuredPlugins=[],this.resourcesToLoad={},this.preTask(function(){return e.loader.normalize("aurelia-bootstrapper").then(function(e){return t.bootstrapperName=e})}),this.postTask(function(){return Fa(e,t.resourcesToLoad,e.resources)})}var t=e.prototype;return t.instance=function(e,t){return this.container.registerInstance(e,t),this},t.singleton=function(e,t){return this.container.registerSingleton(e,t),this},t.transient=function(e,t){return this.container.registerTransient(e,t),this},t.preTask=function(e){return Da(this),this.preTasks.push(e),this},t.postTask=function(e){return Da(this),this.postTasks.push(e),this},t.feature=function(e,t){switch(void 0===t&&(t={}),typeof e){case"string":var n=/\/index$/i.test(e),i=n||qa(e)?e:e+"/index",r=n?e.substr(0,e.length-6):e;this.info.push({moduleId:i,resourcesRelativeTo:[r,""],config:t});break;case"function":this.info.push({configure:e,config:t||{}});break;default:throw new Error(za(e,"feature"))}return this},t.globalResources=function(e){var t=this;Da(this);for(var n,i=Array.isArray(e)?e:arguments,r=this.resourcesRelativeTo||["",""],o=0,s=i.length;o1?t.normalize(n.moduleId,n.resourcesRelativeTo[1]).then(function(e){return r(e)}):r(i)}if("function"==typeof n.configure)return-1!==e.configuredPlugins.indexOf(n.configure)?Promise.resolve():(e.configuredPlugins.push(n.configure),Promise.resolve(n.configure.call(null,e,n.config||{})));throw new Error(za(n.moduleId||n.configure,"plugin"));function r(i){return t.loadModule(i).then(function(t){if("configure"in t)return-1!==e.configuredPlugins.indexOf(t.configure)?Promise.resolve():Promise.resolve(t.configure(e,n.config||{})).then(function(){e.configuredPlugins.push(t.configure),e.resourcesRelativeTo=null,La.debug("Configured plugin "+n.moduleId+".")});e.resourcesRelativeTo=null,La.debug("Loaded plugin "+n.moduleId+".")})}}(e,n,t).then(r):(e.processed=!0,e.configuredPlugins=null,Promise.resolve())}().then(function(){return Ba(e,e.postTasks)})})},e}(),Ja=ie,Za=(Ua=Ha=function(){function e(e){this.elements=Object.create(null),this.allElements=Object.create(null),this.svg=e,this.registerUniversal("accesskey","accessKey"),this.registerUniversal("contenteditable","contentEditable"),this.registerUniversal("tabindex","tabIndex"),this.registerUniversal("textcontent","textContent"),this.registerUniversal("innerhtml","innerHTML"),this.registerUniversal("scrolltop","scrollTop"),this.registerUniversal("scrollleft","scrollLeft"),this.registerUniversal("readonly","readOnly"),this.register("label","for","htmlFor"),this.register("img","usemap","useMap"),this.register("input","maxlength","maxLength"),this.register("input","minlength","minLength"),this.register("input","formaction","formAction"),this.register("input","formenctype","formEncType"),this.register("input","formmethod","formMethod"),this.register("input","formnovalidate","formNoValidate"),this.register("input","formtarget","formTarget"),this.register("textarea","maxlength","maxLength"),this.register("td","rowspan","rowSpan"),this.register("td","colspan","colSpan"),this.register("th","rowspan","rowSpan"),this.register("th","colspan","colSpan")}var t=e.prototype;return t.register=function(e,t,n){e=e.toLowerCase(),t=t.toLowerCase(),(this.elements[e]=this.elements[e]||Object.create(null))[t]=n},t.registerUniversal=function(e,t){e=e.toLowerCase(),this.allElements[e]=t},t.map=function(e,t){if(this.svg.isStandardSvgAttribute(e,t))return t;e=e.toLowerCase(),t=t.toLowerCase();var n=this.elements[e];return void 0!==n&&t in n?n[t]:t in this.allElements?this.allElements[t]:/(?:^data-)|(?:^aria-)|:/.test(t)?t:Pt(t)},e}(),Ha.inject=[co],Ua),eu=function(){function e(e,t,n,i,r,o){this.observerLocator=e,this.targetProperty=t,this.parts=n,this.mode=i,this.lookupFunctions=r,this.attribute=this.attrToRemove=o,this.discrete=!1}return e.prototype.createBinding=function(e){return 3===this.parts.length?new iu(e,this.observerLocator,this.parts[1],this.mode,this.lookupFunctions,this.targetProperty,this.parts[0],this.parts[2]):new nu(this.observerLocator,this.parts,e,this.targetProperty,this.mode,this.lookupFunctions)},e}();function tu(e,t){if("style"===t)Z("templating-binding").info('Internet Explorer does not support interpolation in "style" attributes. Use the style attribute\'s alias, "css" instead.');else if(e.parentElement&&"TEXTAREA"===e.parentElement.nodeName&&"textContent"===t)throw new Error('Interpolation binding cannot be used in the content of a textarea element. Use instead.')}var nu=function(){function e(e,t,n,i,r,o){tu(n,i),this.observerLocator=e,this.parts=t,this.target=n,this.targetProperty=i,this.targetAccessor=e.getAccessor(n,i),this.mode=r,this.lookupFunctions=o}var t=e.prototype;return t.interpolate=function(){if(this.isBound){for(var e="",t=this.parts,n=0,i=t.length;n=Xn.oneTime?n.attributes[t].defaultBindingMode:Xn.oneWay},t.bind=function(e,t,n,i,r){var o=i||ds.attribute(n.attrName);return o.attributes[n.attrName]=new fo(this.observerLocator,this.attributeMap.map(t.tagName,n.attrName),this.parser.parse(n.attrValue),void 0===n.defaultBindingMode||null===n.defaultBindingMode?this.determineDefaultBindingMode(t,n.attrName,r):n.defaultBindingMode,e.lookupFunctions),o},t.trigger=function(e,t,n){return new xo(this.eventManager,n.attrName,this.parser.parse(n.attrValue),Ir.none,!0,e.lookupFunctions)},t.capture=function(e,t,n){return new xo(this.eventManager,n.attrName,this.parser.parse(n.attrValue),Ir.capturing,!0,e.lookupFunctions)},t.delegate=function(e,t,n){return new xo(this.eventManager,n.attrName,this.parser.parse(n.attrValue),Ir.bubbling,!0,e.lookupFunctions)},t.call=function(e,t,n,i){var r=i||ds.attribute(n.attrName);return r.attributes[n.attrName]=new vo(this.observerLocator,n.attrName,this.parser.parse(n.attrValue),e.lookupFunctions),r},t.options=function(e,t,n,i,r){var o,s,a,u=i||ds.attribute(n.attrName),c=n.attrValue,l=this.language,h=null,d="",f=!1,p=!1,v=!1;for(s=0,a=c.length;sl;++l)if(r=(n=a[l]).name,o=n.nodeValue,i=r.split("."),r!==u)if(2===i.length){if("bind"!==i[1]){Z("templating-binding-language").warn('Detected invalid let command. Expected "'+i[0]+'.bind", given "'+r+'"');continue}s.push(new ru(this.observerLocator,Pt(i[0]),this.parser.parse(o),e.lookupFunctions,c))}else r=Pt(r),null===(i=this.parseInterpolation(e,o))&&Z("templating-binding-language").warn('Detected string literal in let bindings. Did you mean "'+r+".bind="+o+'" or "'+r+"=${"+o+'}" ?'),i?s.push(new su(this.observerLocator,r,i,e.lookupFunctions,c)):s.push(new ru(this.observerLocator,r,new Hn(o),e.lookupFunctions,c));return s},n.inspectTextContent=function(e,t){var n=this.parseInterpolation(e,t);return null===n?null:new eu(this.observerLocator,"textContent",n,Xn.oneWay,e.lookupFunctions,"textContent")},n.parseInterpolation=function(e,t){for(var n,i,r,o=t.indexOf("${",0),s=t.length,a=0,u=0,c=null,l=0;o>=0&&o0&&o0&&(t-=1);t0?(a=e.removeViews(d,!0,!e.viewsRequireLifecycle),s=function(){for(var o=0;on;)i--,e.removeView(i,!0,!e.viewsRequireLifecycle);for(var r=e.local,o=0;o0)return Promise.all(o).then(function(){var r=i._handleAddedSplices(e,t,n);Du(e.views(),r)});var d=this._handleAddedSplices(e,t,n);Du(e.views(),d)},t._handleAddedSplices=function(e,t,n){for(var i,r,o=t.length,s=0,a=n.length;su.index)&&(r=i);c0?Promise.all(h).then(function(){Du(e.views(),0)}):Du(e.views(),0)},t._getViewIndexByKey=function(e,t){var n,i;for(n=0,i=e.viewCount();n0?Promise.all(l).then(function(){Du(e.views(),0)}):Du(e.views(),0)},t._getViewIndexByValue=function(e,t){var n,i;for(n=0,i=e.viewCount();n0)for(o>s&&(o=s),n=0,i=o;n)<[^<]*)*<\/script>/gi,_c=function(){function e(){}return e.prototype.sanitize=function(e){return e.replace(Cc,"")},e}(),Sc=yo("sanitizeHTML")(yc=Je(_c)(yc=function(){function e(e){this.sanitizer=e}return e.prototype.toView=function(e){return null==e?null:this.sanitizer.sanitize(e)},e}())||yc)||yc,Ec=Sa("replaceable")(bc=Ea(bc=Je(Us,Is)(bc=function(){function e(e,t){this.viewFactory=e,this.viewSlot=t,this.view=null}var t=e.prototype;return t.bind=function(e,t){null===this.view&&(this.view=this.viewFactory.create(),this.viewSlot.add(this.view)),this.view.bind(e,t)},t.unbind=function(){this.view.unbind()},e}())||bc)||bc)||bc,Ac=Sa("focus",Xn.twoWay)(wc=function(){function e(e,t){this.element=e,this.taskQueue=t,this.isAttached=!1,this.needsApply=!1}e.inject=function(){return[r.Element,Et]};var t=e.prototype;return t.valueChanged=function(e){this.isAttached?this._apply():this.needsApply=!0},t._apply=function(){var e=this;this.value?this.taskQueue.queueMicroTask(function(){e.value&&e.element.focus()}):this.element.blur()},t.attached=function(){this.isAttached=!0,this.needsApply&&(this.needsApply=!1,this._apply()),this.element.addEventListener("focus",this),this.element.addEventListener("blur",this)},t.detached=function(){this.isAttached=!1,this.element.removeEventListener("focus",this),this.element.removeEventListener("blur",this)},t.handleEvent=function(e){"focus"===e.type?this.value=!0:r.activeElement!==this.element&&(this.value=!1)},e}())||wc,Oc=/url\((?!['"]data)([^)]+)\)/gi;var Rc,Pc=function(){function e(e){this.address=e,this._scoped=null,this._global=!1,this._alreadyGloballyInjected=!1}var t=e.prototype;return t.initialize=function(e,t){this._scoped=new t(this)},t.register=function(e,t){"scoped"===t?e.registerViewEngineHooks(this._scoped):this._global=!0},t.load=function(e){var t=this;return e.get(ht).loadText(this.address).catch(function(e){return null}).then(function(e){e=function(e,t){if("string"!=typeof t)throw new Error("Failed loading required CSS file: "+e);return t.replace(Oc,function(t,n){var i=n.charAt(0);return"'"!==i&&'"'!==i||(n=n.substr(1,n.length-2)),"url('"+et(n,e)+"')"})}(t.address,e),t._scoped.css=e,t._global&&(t._alreadyGloballyInjected=!0,r.injectStyles(e))})},e}(),Nc=function(){function e(e){this.owner=e,this.css=null}return e.prototype.beforeCompile=function(e,t,i){if(i.targetShadowDOM)r.injectStyles(this.css,e,!0);else if(n.scopedCSS){r.injectStyles(this.css,e,!0).setAttribute("scoped","scoped")}else this._global&&!this.owner._alreadyGloballyInjected&&(r.injectStyles(this.css),this.owner._alreadyGloballyInjected=!0)},e}();var Tc,Vc,Mc,Ic,Lc,jc,Bc=wo("attr")(Rc=function(){function e(){}var t=e.prototype;return t.bind=function(e,t){e.targetObserver=new Qr(e.target,e.targetProperty)},t.unbind=function(e,t){},e}())||Rc,Fc={bind:function(e,t,n){e.originalMode=e.mode,e.mode=this.mode},unbind:function(e,t){e.mode=e.originalMode,e.originalMode=null}},qc=_e(Fc)(Tc=wo("oneTime")(Tc=function(){this.mode=Xn.oneTime})||Tc)||Tc,Dc=_e(Fc)(Vc=wo("oneWay")(Vc=function(){this.mode=Xn.toView})||Vc)||Vc,zc=_e(Fc)(Mc=wo("toView")(Mc=function(){this.mode=Xn.toView})||Mc)||Mc,Hc=_e(Fc)(Ic=wo("fromView")(Ic=function(){this.mode=Xn.fromView})||Ic)||Ic,Uc=_e(Fc)(Lc=wo("twoWay")(Lc=function(){this.mode=Xn.twoWay})||Lc)||Lc;function Wc(e){var t=this,n=this.throttleState,i=+new Date-n.last;if(i>=n.delay)return clearTimeout(n.timeoutId),n.timeoutId=null,n.last=+new Date,void this.throttledMethod(e);n.newValue=e,null===n.timeoutId&&(n.timeoutId=setTimeout(function(){n.timeoutId=null,n.last=+new Date,t.throttledMethod(n.newValue)},n.delay-i))}var Qc,$c=wo("throttle")(jc=function(){function e(){}var t=e.prototype;return t.bind=function(e,t,n){void 0===n&&(n=200);var i="updateTarget";e.callSource?i="callSource":e.updateSource&&e.mode===Xn.twoWay&&(i="updateSource"),e.throttledMethod=e[i],e.throttledMethod.originalName=i,e[i]=Wc,e.throttleState={delay:n,last:0,timeoutId:null}},t.unbind=function(e,t){e[e.throttledMethod.originalName]=e.throttledMethod,e.throttledMethod=null,clearTimeout(e.throttleState.timeoutId),e.throttleState=null},e}())||jc,Gc={};function Kc(e){var t=this,n=this.debounceState;clearTimeout(n.timeoutId),n.timeoutId=setTimeout(function(){return t.debouncedMethod(e)},n.delay)}function Xc(e,t,n){var i=this,r=this.debounceState;if(clearTimeout(r.timeoutId),e!==r.callContextToDebounce)return r.oldValue=Gc,void this.debouncedMethod(e,t,n);r.oldValue===Gc&&(r.oldValue=n),r.timeoutId=setTimeout(function(){var n=r.oldValue;r.oldValue=Gc,i.debouncedMethod(e,t,n)},r.delay)}var Yc,Jc=wo("debounce")(Qc=function(){function e(){}var t=e.prototype;return t.bind=function(e,t,n){void 0===n&&(n=200);var i=void 0!==e.callSource,r=i?"callSource":"call",o=i?Kc:Xc,s=e.mode,a=s===Xn.twoWay||s===Xn.fromView?"Binding:target":Ot;e.debouncedMethod=e[r],e.debouncedMethod.originalName=r,e[r]=o,e.debounceState={callContextToDebounce:a,delay:n,timeoutId:0,oldValue:Gc}},t.unbind=function(e,t){e[e.debouncedMethod.originalName]=e.debouncedMethod,e.debouncedMethod=null,clearTimeout(e.debounceState.timeoutId),e.debounceState=null},e}())||Qc;function Zc(e){var t=function(e){return e.path&&e.path[0]||e.deepPath&&e.deepPath[0]||e.target}(e);this.target===t&&this.selfEventCallSource(e)}var el,tl,nl=wo("self")(Yc=function(){function e(){}var t=e.prototype;return t.bind=function(e,t){if(!e.callSource||!e.targetEvent)throw new Error("Self binding behavior only supports event.");e.selfEventCallSource=e.callSource,e.callSource=Zc},t.unbind=function(e,t){e.callSource=e.selfEventCallSource,e.selfEventCallSource=null},e}())||Yc,il=function(){function e(){this.signals={}}return e.prototype.signal=function(e){var t=this.signals[e];if(t)for(var n=t.length;n--;)t[n].call(Ot)},e}(),rl=wo("signal")(el=function(){function e(e){this.signals=e.signals}e.inject=function(){return[il]};var t=e.prototype;return t.bind=function(e,t){if(!e.updateTarget)throw new Error("Only property bindings and string interpolation bindings can be signaled. Trigger, delegate and call bindings cannot be signaled.");if(3===arguments.length){var n=arguments[2];(this.signals[n]||(this.signals[n]=[])).push(e),e.signalName=n}else{if(!(arguments.length>3))throw new Error("Signal name is required.");for(var i=Array.prototype.slice.call(arguments,2),r=i.length;r--;){var o=i[r];(this.signals[o]||(this.signals[o]=[])).push(e)}e.signalName=i}},t.unbind=function(e,t){var n=e.signalName;if(e.signalName=null,Array.isArray(n))for(var i=n,r=i.length;r--;){var o=i[r],s=this.signals[o];s.splice(s.indexOf(e),1)}else{var a=this.signals[n];a.splice(a.indexOf(e),1)}},e}())||el,ol="The updateTrigger binding behavior can only be applied to two-way/ from-view bindings on input/select elements.",sl=wo("updateTrigger")(tl=function(){function e(){}var t=e.prototype;return t.bind=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r");if(e.mode!==Xn.twoWay&&e.mode!==Xn.fromView)throw new Error(ol);var o=e.observerLocator.getObserver(e.target,e.targetProperty);if(!o.handler)throw new Error(ol);e.targetObserver=o,o.originalHandler=e.targetObserver.handler;var s=new jr(i);o.handler=s},t.unbind=function(e,t){e.targetObserver.handler.dispose(),e.targetObserver.handler=e.targetObserver.originalHandler,e.targetObserver.originalHandler=null},e}())||tl;function al(e,t,n){for(var i,r=_a(e)(i=Na(t)(i=function(){function e(){}return e.prototype.bind=function(e){this.$parent=e},e}())||i)||i,o=0,s=n.length;o=t.length)break;r=t[i++]}else{if((i=t.next()).done)break;r=i.value}var o=r;if(o.charSpec.validChars===e.validChars&&o.charSpec.invalidChars===e.invalidChars)return o}},t.put=function(t){var n=this.get(t);return n||(n=new e(t),this.nextStates.push(n),t.repeat&&n.nextStates.push(n),n)},t.match=function(e){for(var t=this.nextStates,n=[],i=0,r=t.length;i1&&"/"===r.charAt(a-1)&&(r=r.substr(0,a-1),i=!0);for(var u=0,c=r.length;ui&&(t.isNavigatingBack=!0):t.isNavigatingRefresh=!0:t.isNavigatingNew=!0:(t.isNavigatingFirst=!0,t.isNavigatingNew=!0),i||(i=Date.now(),t.history.setState("NavigationTracker",i)),t.currentNavigationTracker=i,n.previousInstruction=t.currentInstruction;var o=t.maxInstructionCount;if(e){if(e===o-1)return Lh.error(e+1+" navigation instructions have been attempted without success. Restoring last known good location."),qh(t),t._dequeueInstruction(e+1);if(e>o)throw new Error("Maximum navigation attempts exceeded. Giving up.")}else t.events.publish("router:navigation:processing",{instruction:n});return t.pipelineProvider.createPipeline(!t.couldDeactivate).run(n).then(function(i){return Bh(n,i,e,t)}).catch(function(e){return{output:e instanceof Error?e:new Error(e)}}).then(function(i){return Fh(n,i,!!e,t)})}}})},n._findViewModel=function(e){if(this.container.viewModel)return this.container.viewModel;if(e.container)for(var t=e.container;t;){if(t.viewModel)return this.container.viewModel=t.viewModel,t.viewModel;t=t.parent}},t}(Gl),Bh=function(e,t,n,i){t&&"completed"in t&&"output"in t||((t=t||{}).output=new Error("Expected router pipeline to return a navigation result, but got ["+JSON.stringify(t)+"] instead."));var r=null,o=null;return eh(t.output)?o=t.output.navigate(i):(r=t,t.completed||(t.output instanceof Error&&Lh.error(t.output.toString()),qh(i))),Promise.resolve(o).then(function(e){return i._dequeueInstruction(n+1)}).then(function(e){return r||e||t})},Fh=function(e,t,n,i){e.resolve(t);var r=i.events,o={instruction:e,result:t};if(n)r.publish("router:navigation:child:complete",o);else{var s;if(i.isNavigating=!1,i.isExplicitNavigation=!1,i.isExplicitNavigationBack=!1,i.isNavigatingFirst=!1,i.isNavigatingNew=!1,i.isNavigatingRefresh=!1,i.isNavigatingForward=!1,i.isNavigatingBack=!1,i.couldDeactivate=!1,t.output instanceof Error)s="router:navigation:error";else if(t.completed){var a=e.queryString?"?"+e.queryString:"";i.history.previousLocation=e.fragment+a,s="router:navigation:success"}else s="router:navigation:canceled";r.publish(s,o),r.publish("router:navigation:complete",o)}return t},qh=function(e){var t=e.history.previousLocation;t?e.navigate(t,{trigger:!1,replace:!0}):e.fallbackRoute?e.navigate(e.fallbackRoute,{trigger:!0,replace:!0}):Lh.error("Router navigation failed, and no previous location or fallbackRoute could be restored.")};(mh=e.PipelineStatus||(e.PipelineStatus={})).Completed="completed",mh.Canceled="canceled",mh.Rejected="rejected",mh.Running="running",function(e){e.Processing="router:navigation:processing",e.Error="router:navigation:error",e.Canceled="router:navigation:canceled",e.Complete="router:navigation:complete",e.Success="router:navigation:success",e.ChildComplete="router:navigation:child:complete"}(yh||(yh={})),function(e){e.Authorize="authorize",e.PreActivate="preActivate",e.PreRender="preRender",e.PostRender="postRender"}(bh||(bh={}));var Dh=function(){},zh=function(){function e(e,t,n,i,r,o,s){this.element=e,this.container=t,this.viewSlot=n,this.router=i,this.viewLocator=r,this.compositionTransaction=o,this.compositionEngine=s,this.router.registerViewPort(this,this.element.getAttribute("name")),"initialComposition"in o||(o.initialComposition=!0,this.compositionTransactionNotifier=o.enlist())}e.inject=function(){return[r.Element,Xe,Is,Gl,Cs,ns,xa]};var t=e.prototype;return t.created=function(e){this.owningView=e},t.bind=function(e,t){this.container.viewModel=e,this.overrideContext=t},t.process=function(e,t){var n=this,i=e,r=i.component,o=r.childContainer,s=r.viewModel,a=r.viewModelResource,u=a.metadata,c=r.router.currentInstruction.config,l=c.viewPorts&&c.viewPorts[i.name]||{};o.get(Hh)._notify(this);var h={viewModel:l.layoutViewModel||c.layoutViewModel||this.layoutViewModel,view:l.layoutView||c.layoutView||this.layoutView,model:l.layoutModel||c.layoutModel||this.layoutModel,router:i.component.router,childContainer:o,viewSlot:this.viewSlot},d=this.viewLocator.getViewStrategy(r.view||s);return d&&r.view&&d.makeRelativeTo(Ce.get(r.router.container.viewModel.constructor).moduleId),u.load(o,a.value,null,d,!0).then(function(e){n.compositionTransactionNotifier||(n.compositionTransactionOwnershipToken=n.compositionTransaction.tryCapture()),(h.viewModel||h.view)&&(i.layoutInstruction=h);var r=ds.dynamic(n.element,s,e);if(i.controller=u.create(o,r),t)return null;n.swap(i)})},t.swap=function(e){var t=this,n=e,i=n.controller,r=n.layoutInstruction,o=this.view,s=function(){var e=ba[t.swapOrder]||ba.after,n=t.viewSlot;e(n,o,function(){return Promise.resolve(n.add(t.view))}).then(function(){t._notify()})},a=function(e){i.automate(t.overrideContext,e);var n=t.compositionTransactionOwnershipToken;return n?n.waitForCompositionComplete().then(function(){return t.compositionTransactionOwnershipToken=null,s()}):s()};return r?(r.viewModel||(r.viewModel=new Dh),this.compositionEngine.createController(r).then(function(e){var n=e.view;return Ps.distributeView(i.view,e.slots||n.slots),e.automate(Nt(r.viewModel),t.owningView),n.children.push(i.view),n||e}).then(function(e){return t.view=e,a(e)})):(this.view=i.view,a(this.owningView))},t._notify=function(){var e=this.compositionTransactionNotifier;e&&(e.done(),this.compositionTransactionNotifier=null)},e}();zh.$view=null,zh.$resource={name:"router-view",bindables:["swapOrder","layoutView","layoutViewModel","layoutModel","inherit-binding-context"]};var Hh=function(){function e(){var e=this;this.promise=new Promise(function(t){return e.resolve=t})}var t=e.prototype;return t.findNearest=function(){return this.promise},t._notify=function(e){this.resolve(e)},e}(),Uh=function(){};Ta("")(Uh);var Wh=function(e){function t(t){var n;return(n=e.call(this)||this).compositionEngine=t,n}se(t,e);var n=t.prototype;return n.resolveViewModel=function(e,t){return new Promise(function(n,i){var r;if("moduleId"in t){var o=t.moduleId;return null===o?r=Uh:(o=et(o,Ce.get(e.container.viewModel.constructor).moduleId),r=/\.html/i.test(o)?function(e){var t=/([^\/^\?]+)\.html/i.exec(e)[1],n=function(){function e(){}var t=e.prototype;return t.bind=function(e){this.$parent=e},e}();return _a(t)(n),Na(e)(n),n}(o):o),n(r)}i(new Error('Invalid route config. No "moduleId" found.'))})},n.createChildContainer=function(e){var t=e.container.createChild();return t.registerSingleton(Hh),t.getChildRouter=function(){var n;return t.registerHandler(Gl,function(){return n||(n=e.createChild(t))}),t.get(Gl)},t},n.loadRoute=function(e,t,n){var i=this;return this.resolveViewModel(e,t).then(function(n){return i.compositionEngine.ensureViewModel({viewModel:n,childContainer:i.createChildContainer(e),view:t.view||t.viewStrategy,router:e})})},t}(ph);Wh.inject=[xa];var Qh=Z("route-href"),$h=function(){function e(e,t){this.router=e,this.element=t,this.attribute="href"}e.inject=function(){return[Gl,r.Element]};var t=e.prototype;return t.bind=function(){this.isActive=!0,this.processChange()},t.unbind=function(){this.isActive=!1},t.attributeChanged=function(e,t){return t&&this.element.removeAttribute(t),this.processChange()},t.processChange=function(){var e=this;return this.router.ensureConfigured().then(function(){if(!e.isActive)return null;var t=e.element,n=e.router.generate(e.route,e.params);return t.au.controller?t.au.controller.viewModel[e.attribute]=n:t.setAttribute(e.attribute,n),null}).catch(function(e){Qh.error(e)})},e}();function Gh(e){e.singleton(ph,Wh).singleton(Gl,jh).globalResources(zh,$h),e.container.registerAlias(Gl,jh)}$h.$resource={type:"attribute",name:"route-href",bindables:[{name:"route",changeHandler:"processChange",primaryProperty:!0},{name:"params",changeHandler:"processChange"},"attribute"]};var Kh,Xh=function(){function e(){}var t=e.prototype;return t.debug=function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r1?n-1:0),r=1;r1?n-1:0),r=1;r1?n-1:0),r=1;r1?t-1:0),i=1;i=1?r(e):r()},e.noView=Va,e.observable=function(e,t,n){function i(e,t,n,i){var r=void 0===t;r&&(e=e.prototype,t="string"==typeof i?i:i.name);var o="_"+t,s={configurable:!0,enumerable:!1,writable:!0},a=i&&i.changeHandler||t+"Changed";if(n?"function"==typeof n.initializer&&(s.value=n.initializer()):n={},"enumerable"in n||(n.enumerable=!0),delete n.value,delete n.writable,delete n.initializer,Reflect.defineProperty(e,o,s),n.get=function(){return this[o]},n.set=function(e){var n=this[o];e!==n&&(this[o]=e,Reflect.defineProperty(this,o,{enumerable:!1}),this[a]&&this[a](e,n,t))},n.get.dependencies=[o],!r)return n;Reflect.defineProperty(e,t,n)}return void 0===t?function(t,n,r){return i(t,n,r,e)}:i(e,t,n)},e.optional=function(e){void 0===e&&(e=!0);var t=function(e){return function(t,n,i){var r=Fe(t);r[i]=Ie.of(r[i],e)}};return t("boolean"!=typeof e||e)},e.parent=function(e,t,n){var i=Fe(e);i[n]=Le.of(i[n])},e.parseQueryString=ut,e.presentationAttributes=uo,e.presentationElements=ao,e.processAttributes=function(e){return function(t){we.getOrCreateOwn(we.resource,ha,t).processAttributes=function(t,n,i,r,o){try{e(t,n,i,r,o)}catch(e){Z("templating").error(e)}}}},e.processContent=function(e){return function(t){we.getOrCreateOwn(we.resource,ha,t).processContent=e?function(t,n,i,r){try{return e(t,n,i,r)}catch(e){return Z("templating").error(e),!1}}:Ra}},e.projectArraySplices=pn,e.propertyAccessor=Dr,e.protocol=Pe,e.registration=De,e.relativeToFile=et,e.reset=function(){e.isInitialized=!1},e.resolver=Ne,e.resource=Ca,e.setConnectQueueThreshold=Xt,e.signalBindings=function(e){Yo.hasOwnProperty(e)&&Yo[e]++},e.singleton=function(e,t){return void 0===t&&(t=!1),De(new He(e,t))},e.sourceContext=Ot,e.start=function(e){return void 0===e&&(e={}),Yh(e).then(function(t){return t.setRoot(e.root||"app.js",e.host||document.body)})},e.subscriberCollection=sn,e.targetContext="Binding:target",e.templateController=Ea,e.transient=function(e){return De(new ze(e))},e.unwrapExpression=Wu,e.updateOneTimeBinding=$u,e.updateOverrideContext=Hu,e.useShadowDOM=function(e){var t="function"!=typeof e&&e?e:Oa,n=function(e){var n=we.getOrCreateOwn(we.resource,ha,e);n.targetShadowDOM=!0,n.shadowDOMOptions=t};return"function"==typeof e?n(e):n},e.useView=Na,e.useViewStrategy=Pa,e.validateBehaviorName=Ts,e.valueConverter=yo,e.view=function(e){return function(t){t.$view=e}},e.viewEngineHooks=function(e){var t=function(e){we.define(we.resource,new as,e)};return e?t(e):t},e.viewResources=function(){for(var e=arguments.length,t=new Array(e),n=0;n