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qBACf,YAAe,MACf,QAAW,CACP,CACI,WAAc,QAI1B,CACI,YAAe,qBACf,YAAe,gBACf,QAAW,CACP,CACI,WAAc,MAElB,CACI,MAAS,aAIrB,CACI,YAAe,qBACf,YAAe,kBACf,QAAW,CACP,CACI,WAAc,cAElB,CACI,MAAS,aAIrB,CACI,YAAe,oBACf,YAAe,gBACf,QAAW,CACP,CACI,MAAS,aAIrB,CACI,YAAe,oBACf,YAAe,cACf,QAAW,CACP,CACI,WAAc,SAI1B,CACI,YAAe,iBACf,YAAe,MACf,QAAW,CACP,CACI,WAAc,SAI1B,CACI,YAAe,iBACf,YAAe,cACf,QAAW,CACP,CACI,WAAc,SAI1B,CACI,YAAe,eACf,YAAe,MACf,QAAW,CACP,CACI,WAAc,SAI1B,CACI,YAAe,iBACf,YAAe,WACf,QAAW,CACP,CACI,WAAc,SAI1B,CACI,YAAe,cACf,YAAe,MACf,QAAW,CACP,CACI,WAAc,SAI1B,CACI,YAAe,WACf,YAAe,MACf,QAAW,CACP,CACI,MAAS,WAEb,CACI,MAAS,QAIrB,CACI,YAAe,WACf,YAAe,mBACf,QAAW,CACP,CACI,MAAS,aAIrB,CACI,YAAe,WACf,YAAe,cACf,QAAW,CACP,CACI,WAAc,SAI1B,CACI,YAAe,uBACf,YAAe,MACf,QAAW,CACP,CACI,WAAc,SAI1B,CACI,YAAe,aACf,YAAe,MACf,QAAW,CACP,CACI,WAAc,SAI1B,CACI,YAAe,qBACf,YAAe,MACf,QAAW,CACP,CACI,WAAc,SAI1B,CACI,YAAe,qBACf,YAAe,WACf,QAAW,CACP,CACI,MAAS,WAEb,CACI,WAAc,SAI1B,CACI,YAAe,OACf,YAAe,SACf,QAAW,CACP,CACI,WAAc,OAElB,CACI,WAAc,SAI1B,CACI,YAAe,OACf,YAAe,cACf,QAAW,CACP,CACI,WAAc,MAElB,CACI,MAAS,aAIrB,CACI,YAAe,OACf,YAAe,qBACf,QAAW,CACP,CACI,WAAc,SAI1B,CACI,YAAe,eACf,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M,MAC5G,EAGU,IAAI,EAAkB,OAAY,UAAYkE,EAAe,OAAGA,EAAa,MAAI/D,OAAQ,MAAU,eAE9G,CDuCA0F,EAAQC,IAAIxO,IAAK,gBAAgB,SAAUmE,GACvC,OAAO,IAAIsR,GAAc5M,OAAQ1E,EACrC,IEvEA,MAAc,CAAEuR,IAAI,CAAC,aAAa,sUAA4V,eAAe,kqKAA4gL,eAAe,qHAA6H,kBAAkB,k0BAAw1B,kBAAkB","sources":["webpack://main/./node_modules/es6-promise/auto.js","webpack://main/./node_modules/es6-promise/dist/es6-promise.js","webpack://main/webpack/bootstrap","webpack://main/webpack/runtime/define property getters","webpack://main/webpack/runtime/global","webpack://main/webpack/runtime/hasOwnProperty shorthand","webpack://main/webpack/runtime/make namespace object","webpack://main/./typescript/lib/ts-lib/src/core/signal/Signal.ts","webpack://main/./typescript/lib/ts-lib/src/core/node/signal/DOMEventSignal.ts","webpack://main/./typescript/lib/ts-lib/src/core/node/signal/NodeSignal.ts","webpack://main/./typescript/lib/ts-lib/src/core/node/Node.ts","webpack://main/./typescript/lib/ts-lib/src/core/lookup/LookupDict.ts","webpack://main/./typescript/lib/ts-lib/src/core/lookup/LookupObject.ts","webpack://main/./typescript/lib/ts-lib/src/core/js.ts","webpack://main/./typescript/lib/ts-lib/src/core/template/TemplateRenderer.ts","webpack://main/./typescript/lib/ts-lib/src/core/template/TemplateManager.ts","webpack://main/./typescript/lib/ts-lib/src/core/lang/Lang.ts","webpack://main/./typescript/lib/ts-lib/src/core/request/Request.ts","webpack://main/./typescript/lib/ts-lib/src/core/setup/Asset.ts","webpack://main/./typescript/lib/ts-lib/src/core/setup/setup.ts","webpack://main/./typescript/lib/ts-lib/src/core/view/View.ts","webpack://main/./typescript/lib/ts-lib/src/core/ioc/IoC.ts","webpack://main/./typescript/lib/ts-lib/src/core/view/Scanner.ts","webpack://main/./typescript/src/MapStyles.ts","webpack://main/./typescript/src/GoogleMapElement.ts","webpack://main/./typescript/src/OfferFilter.ts","webpack://main/./typescript/src/OfferDetail.ts","webpack://main/./typescript/src/Main.ts","webpack://main/./typescript/src/templates/template.ts"],"sourcesContent":["// This file can be required in Browserify and Node.js for automatic polyfill\n// To use it: require('es6-promise/auto');\n'use strict';\nmodule.exports = require('./').polyfill();\n","/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version v4.2.8+1e68dce6\n */\n\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.ES6Promise = factory());\n}(this, (function () { 'use strict';\n\nfunction objectOrFunction(x) {\n var type = typeof x;\n return x !== null && (type === 'object' || type === 'function');\n}\n\nfunction isFunction(x) {\n return typeof x === 'function';\n}\n\n\n\nvar _isArray = void 0;\nif (Array.isArray) {\n _isArray = Array.isArray;\n} else {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n}\n\nvar isArray = _isArray;\n\nvar len = 0;\nvar vertxNext = void 0;\nvar customSchedulerFn = void 0;\n\nvar asap = function asap(callback, arg) {\n queue[len] = callback;\n queue[len + 1] = arg;\n len += 2;\n if (len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (customSchedulerFn) {\n customSchedulerFn(flush);\n } else {\n scheduleFlush();\n }\n }\n};\n\nfunction setScheduler(scheduleFn) {\n customSchedulerFn = scheduleFn;\n}\n\nfunction setAsap(asapFn) {\n asap = asapFn;\n}\n\nvar browserWindow = typeof window !== 'undefined' ? window : undefined;\nvar browserGlobal = browserWindow || {};\nvar BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\nvar isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';\n\n// test for web worker but not in IE10\nvar isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n// node\nfunction useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function () {\n return process.nextTick(flush);\n };\n}\n\n// vertx\nfunction useVertxTimer() {\n if (typeof vertxNext !== 'undefined') {\n return function () {\n vertxNext(flush);\n };\n }\n\n return useSetTimeout();\n}\n\nfunction useMutationObserver() {\n var iterations = 0;\n var observer = new BrowserMutationObserver(flush);\n var node = document.createTextNode('');\n observer.observe(node, { characterData: true });\n\n return function () {\n node.data = iterations = ++iterations % 2;\n };\n}\n\n// web worker\nfunction useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = flush;\n return function () {\n return channel.port2.postMessage(0);\n };\n}\n\nfunction useSetTimeout() {\n // Store setTimeout reference so es6-promise will be unaffected by\n // other code modifying setTimeout (like sinon.useFakeTimers())\n var globalSetTimeout = setTimeout;\n return function () {\n return globalSetTimeout(flush, 1);\n };\n}\n\nvar queue = new Array(1000);\nfunction flush() {\n for (var i = 0; i < len; i += 2) {\n var callback = queue[i];\n var arg = queue[i + 1];\n\n callback(arg);\n\n queue[i] = undefined;\n queue[i + 1] = undefined;\n }\n\n len = 0;\n}\n\nfunction attemptVertx() {\n try {\n var vertx = Function('return this')().require('vertx');\n vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return useVertxTimer();\n } catch (e) {\n return useSetTimeout();\n }\n}\n\nvar scheduleFlush = void 0;\n// Decide what async method to use to triggering processing of queued callbacks:\nif (isNode) {\n scheduleFlush = useNextTick();\n} else if (BrowserMutationObserver) {\n scheduleFlush = useMutationObserver();\n} else if (isWorker) {\n scheduleFlush = useMessageChannel();\n} else if (browserWindow === undefined && typeof require === 'function') {\n scheduleFlush = attemptVertx();\n} else {\n scheduleFlush = useSetTimeout();\n}\n\nfunction then(onFulfillment, onRejection) {\n var parent = this;\n\n var child = new this.constructor(noop);\n\n if (child[PROMISE_ID] === undefined) {\n makePromise(child);\n }\n\n var _state = parent._state;\n\n\n if (_state) {\n var callback = arguments[_state - 1];\n asap(function () {\n return invokeCallback(_state, child, callback, parent._result);\n });\n } else {\n subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n}\n\n/**\n `Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n resolve(1);\n });\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.resolve(1);\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n @method resolve\n @static\n @param {Any} value value that the returned promise will be resolved with\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n*/\nfunction resolve$1(object) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(noop);\n resolve(promise, object);\n return promise;\n}\n\nvar PROMISE_ID = Math.random().toString(36).substring(2);\n\nfunction noop() {}\n\nvar PENDING = void 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\n\nfunction selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n}\n\nfunction cannotReturnOwn() {\n return new TypeError('A promises callback cannot return that same promise.');\n}\n\nfunction tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {\n try {\n then$$1.call(value, fulfillmentHandler, rejectionHandler);\n } catch (e) {\n return e;\n }\n}\n\nfunction handleForeignThenable(promise, thenable, then$$1) {\n asap(function (promise) {\n var sealed = false;\n var error = tryThen(then$$1, thenable, function (value) {\n if (sealed) {\n return;\n }\n sealed = true;\n if (thenable !== value) {\n resolve(promise, value);\n } else {\n fulfill(promise, value);\n }\n }, function (reason) {\n if (sealed) {\n return;\n }\n sealed = true;\n\n reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n reject(promise, error);\n }\n }, promise);\n}\n\nfunction handleOwnThenable(promise, thenable) {\n if (thenable._state === FULFILLED) {\n fulfill(promise, thenable._result);\n } else if (thenable._state === REJECTED) {\n reject(promise, thenable._result);\n } else {\n subscribe(thenable, undefined, function (value) {\n return resolve(promise, value);\n }, function (reason) {\n return reject(promise, reason);\n });\n }\n}\n\nfunction handleMaybeThenable(promise, maybeThenable, then$$1) {\n if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {\n handleOwnThenable(promise, maybeThenable);\n } else {\n if (then$$1 === undefined) {\n fulfill(promise, maybeThenable);\n } else if (isFunction(then$$1)) {\n handleForeignThenable(promise, maybeThenable, then$$1);\n } else {\n fulfill(promise, maybeThenable);\n }\n }\n}\n\nfunction resolve(promise, value) {\n if (promise === value) {\n reject(promise, selfFulfillment());\n } else if (objectOrFunction(value)) {\n var then$$1 = void 0;\n try {\n then$$1 = value.then;\n } catch (error) {\n reject(promise, error);\n return;\n }\n handleMaybeThenable(promise, value, then$$1);\n } else {\n fulfill(promise, value);\n }\n}\n\nfunction publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n publish(promise);\n}\n\nfunction fulfill(promise, value) {\n if (promise._state !== PENDING) {\n return;\n }\n\n promise._result = value;\n promise._state = FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n asap(publish, promise);\n }\n}\n\nfunction reject(promise, reason) {\n if (promise._state !== PENDING) {\n return;\n }\n promise._state = REJECTED;\n promise._result = reason;\n\n asap(publishRejection, promise);\n}\n\nfunction subscribe(parent, child, onFulfillment, onRejection) {\n var _subscribers = parent._subscribers;\n var length = _subscribers.length;\n\n\n parent._onerror = null;\n\n _subscribers[length] = child;\n _subscribers[length + FULFILLED] = onFulfillment;\n _subscribers[length + REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n asap(publish, parent);\n }\n}\n\nfunction publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) {\n return;\n }\n\n var child = void 0,\n callback = void 0,\n detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n}\n\nfunction invokeCallback(settled, promise, callback, detail) {\n var hasCallback = isFunction(callback),\n value = void 0,\n error = void 0,\n succeeded = true;\n\n if (hasCallback) {\n try {\n value = callback(detail);\n } catch (e) {\n succeeded = false;\n error = e;\n }\n\n if (promise === value) {\n reject(promise, cannotReturnOwn());\n return;\n }\n } else {\n value = detail;\n }\n\n if (promise._state !== PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n resolve(promise, value);\n } else if (succeeded === false) {\n reject(promise, error);\n } else if (settled === FULFILLED) {\n fulfill(promise, value);\n } else if (settled === REJECTED) {\n reject(promise, value);\n }\n}\n\nfunction initializePromise(promise, resolver) {\n try {\n resolver(function resolvePromise(value) {\n resolve(promise, value);\n }, function rejectPromise(reason) {\n reject(promise, reason);\n });\n } catch (e) {\n reject(promise, e);\n }\n}\n\nvar id = 0;\nfunction nextId() {\n return id++;\n}\n\nfunction makePromise(promise) {\n promise[PROMISE_ID] = id++;\n promise._state = undefined;\n promise._result = undefined;\n promise._subscribers = [];\n}\n\nfunction validationError() {\n return new Error('Array Methods must be provided an Array');\n}\n\nvar Enumerator = function () {\n function Enumerator(Constructor, input) {\n this._instanceConstructor = Constructor;\n this.promise = new Constructor(noop);\n\n if (!this.promise[PROMISE_ID]) {\n makePromise(this.promise);\n }\n\n if (isArray(input)) {\n this.length = input.length;\n this._remaining = input.length;\n\n this._result = new Array(this.length);\n\n if (this.length === 0) {\n fulfill(this.promise, this._result);\n } else {\n this.length = this.length || 0;\n this._enumerate(input);\n if (this._remaining === 0) {\n fulfill(this.promise, this._result);\n }\n }\n } else {\n reject(this.promise, validationError());\n }\n }\n\n Enumerator.prototype._enumerate = function _enumerate(input) {\n for (var i = 0; this._state === PENDING && i < input.length; i++) {\n this._eachEntry(input[i], i);\n }\n };\n\n Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {\n var c = this._instanceConstructor;\n var resolve$$1 = c.resolve;\n\n\n if (resolve$$1 === resolve$1) {\n var _then = void 0;\n var error = void 0;\n var didError = false;\n try {\n _then = entry.then;\n } catch (e) {\n didError = true;\n error = e;\n }\n\n if (_then === then && entry._state !== PENDING) {\n this._settledAt(entry._state, i, entry._result);\n } else if (typeof _then !== 'function') {\n this._remaining--;\n this._result[i] = entry;\n } else if (c === Promise$1) {\n var promise = new c(noop);\n if (didError) {\n reject(promise, error);\n } else {\n handleMaybeThenable(promise, entry, _then);\n }\n this._willSettleAt(promise, i);\n } else {\n this._willSettleAt(new c(function (resolve$$1) {\n return resolve$$1(entry);\n }), i);\n }\n } else {\n this._willSettleAt(resolve$$1(entry), i);\n }\n };\n\n Enumerator.prototype._settledAt = function _settledAt(state, i, value) {\n var promise = this.promise;\n\n\n if (promise._state === PENDING) {\n this._remaining--;\n\n if (state === REJECTED) {\n reject(promise, value);\n } else {\n this._result[i] = value;\n }\n }\n\n if (this._remaining === 0) {\n fulfill(promise, this._result);\n }\n };\n\n Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {\n var enumerator = this;\n\n subscribe(promise, undefined, function (value) {\n return enumerator._settledAt(FULFILLED, i, value);\n }, function (reason) {\n return enumerator._settledAt(REJECTED, i, reason);\n });\n };\n\n return Enumerator;\n}();\n\n/**\n `Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n\n If any of the `promises` given to `all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = reject(new Error(\"2\"));\n let promise3 = reject(new Error(\"3\"));\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n\n @method all\n @static\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n*/\nfunction all(entries) {\n return new Enumerator(this, entries).promise;\n}\n\n/**\n `Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n\n Example:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 2');\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // result === 'promise 2' because it was resolved before promise1\n // was resolved.\n });\n ```\n\n `Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error('promise 2'));\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === 'promise 2' because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n\n An example real-world use case is implementing timeouts:\n\n ```javascript\n Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n\n @method race\n @static\n @param {Array} promises array of promises to observe\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n*/\nfunction race(entries) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (!isArray(entries)) {\n return new Constructor(function (_, reject) {\n return reject(new TypeError('You must pass an array to race.'));\n });\n } else {\n return new Constructor(function (resolve, reject) {\n var length = entries.length;\n for (var i = 0; i < length; i++) {\n Constructor.resolve(entries[i]).then(resolve, reject);\n }\n });\n }\n}\n\n/**\n `Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.reject(new Error('WHOOPS'));\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n @method reject\n @static\n @param {Any} reason value that the returned promise will be rejected with.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n*/\nfunction reject$1(reason) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(noop);\n reject(promise, reason);\n return promise;\n}\n\nfunction needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n}\n\nfunction needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n}\n\n/**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n let promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n let xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {Function} resolver\n Useful for tooling.\n @constructor\n*/\n\nvar Promise$1 = function () {\n function Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n }\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n Chaining\n --------\n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n Assimilation\n ------------\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n If the assimliated promise rejects, then the downstream promise will also reject.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n Simple Example\n --------------\n Synchronous Example\n ```javascript\n let result;\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n Advanced Example\n --------------\n Synchronous Example\n ```javascript\n let author, books;\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n function foundBooks(books) {\n }\n function failure(reason) {\n }\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n\n\n Promise.prototype.catch = function _catch(onRejection) {\n return this.then(null, onRejection);\n };\n\n /**\n `finally` will be invoked regardless of the promise's fate just as native\n try/catch/finally behaves\n \n Synchronous example:\n \n ```js\n findAuthor() {\n if (Math.random() > 0.5) {\n throw new Error();\n }\n return new Author();\n }\n \n try {\n return findAuthor(); // succeed or fail\n } catch(error) {\n return findOtherAuther();\n } finally {\n // always runs\n // doesn't affect the return value\n }\n ```\n \n Asynchronous example:\n \n ```js\n findAuthor().catch(function(reason){\n return findOtherAuther();\n }).finally(function(){\n // author was either found, or not\n });\n ```\n \n @method finally\n @param {Function} callback\n @return {Promise}\n */\n\n\n Promise.prototype.finally = function _finally(callback) {\n var promise = this;\n var constructor = promise.constructor;\n\n if (isFunction(callback)) {\n return promise.then(function (value) {\n return constructor.resolve(callback()).then(function () {\n return value;\n });\n }, function (reason) {\n return constructor.resolve(callback()).then(function () {\n throw reason;\n });\n });\n }\n\n return promise.then(callback, callback);\n };\n\n return Promise;\n}();\n\nPromise$1.prototype.then = then;\nPromise$1.all = all;\nPromise$1.race = race;\nPromise$1.resolve = resolve$1;\nPromise$1.reject = reject$1;\nPromise$1._setScheduler = setScheduler;\nPromise$1._setAsap = setAsap;\nPromise$1._asap = asap;\n\n/*global self*/\nfunction polyfill() {\n var local = void 0;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise$1;\n}\n\n// Strange compat..\nPromise$1.polyfill = polyfill;\nPromise$1.Promise = Promise$1;\n\nreturn Promise$1;\n\n})));\n\n\n\n//# sourceMappingURL=es6-promise.map\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\n\ninterface Slot {\n\tlistener:T;\n\tcontext:any;\n\tisOnce:boolean;\n}\n\n/**\n * A common interface for signal callback that return nothing\n */\nexport interface EmptyCallback {\n\t()\n}\n\n/**\n* A signal class that is inspired by https://github.com/robertpenner/as3-signals\n* This is an alternative to the classical Event System.\n* It wraps an event type into a property of a class and allows to register directly on the property\n*/\nexport class Signal {\n\t\n\tslots:Slot[] = [];\n\n\t/**\n\t\t* Registers a function to this signal.\n\t\t*/\n\tpublic add( listener:T, context:any = null ):void {\n\t\tthis.slots.push( { listener:listener, context:context, isOnce:false } );\n\t}\n\t\n\t/**\n\t\t* Registers a function to this signal only once\n\t\t*/\n\tpublic addOnce( listener:T, context:any = null ):void {\n\t\tthis.slots.push( { listener:listener, context:context, isOnce:true } );\n\t}\n\t\n\t/**\n\t\t* Removes a listener from the signal\n\t\t*/\n\tpublic remove( listener:T, context:any = null ) {\n\t\tthis.slots = this.slots.filter( function( slot ) {\n\t\t\treturn slot.listener != listener || slot.context != context;\n\t\t});\n\t}\n\n\t/**\n\t * Removes all listeners from signal\n\t */\n\tpublic removeAll() {\n\t\tthis.slots = [];\n\t}\n\t\n\t/**\n\t\t* Returns true is this signal has the given listener function added.\n\t\t*/\n\tpublic has( listener:T, context:any = null ) {\n\t\treturn this.slots.some( function( slot ) {\n\t\t\treturn slot.listener == listener && slot.context == context;\n\t\t});\n\t}\n\t\n\t\n\t/**\n\t\t* Dispatches an event with the given arguments\n\t\t*/\n\tpublic dispatch( ...args:any[] ):void {\n\t\t\n\t\tthis.slots.forEach( ( slot ) => {\n\t\t\tvar func:any = slot.listener;\n\t\t\tfunc.apply( slot.context, args );\n\t\t\tif( slot.isOnce ) this.remove( slot.listener, slot.context );\n\t\t});\n\t}\n}\n\n\n\nexport default Signal;","import Signal from '../../signal/Signal';\n\n/**\n\t* This class registers itself on native DOM events.\n\t*/\nclass DOMEventSignal extends Signal {\n\t\n\tprotected target:EventTarget;\n\tprotected event:string;\n\tprotected callback:( event ) => void = null;\n\t\n\tconstructor( target:EventTarget, event:string ) {\n\t\t\n\t\tsuper();\t\t\t\n\t\tthis.target = target;\n\t\tthis.event = event;\n\t}\n\t\n\t/**\n\t\t* Registers a function to this signal.\n\t\t*/\n\tpublic add( listener:T, context:any = null ):void {\n\t\t\n\t\tif( this.callback === null ) this.register();\n\t\tsuper.add( listener, context );\n\t}\n\t\n\t/**\n\t\t* Registers a function to this signal only once\n\t\t*/\n\tpublic addOnce( listener:T, context:any = null ):void {\n\t\tif( this.callback === null ) this.register();\n\t\tsuper.addOnce( listener, context );\n\t}\n\t\n\t/**\n\t\t* Removes a listener from the signal\n\t\t*/\n\tpublic remove( listener:T, context:any = null ) {\n\t\tsuper.remove( listener, context );\n\t\tif( this.slots.length == 0 ) this.unregister();\n\t}\n\t\n\t/**\n\t\t* Registers the event on the node and setups the callback function.\n\t\t*/\n\tpublic register() {\n\t\t\n\t\tthis.callback = ( event:Event ) => {\n\t\t\tthis.dispatchEvent( event );\n\t\t};\n\t\t\n\t\tthis.target.addEventListener( this.event, this.callback );\n\t}\n\t\n\t/**\n\t\t* Unregisters the event from the html element\n\t\t*/\n\tpublic unregister() {\n\t\tthis.target.removeEventListener( this.event, this.callback );\n\t\tthis.callback = null;\n\t}\n\t\n\t/**\n\t * \n\t */\n\tprotected dispatchEvent( event:Event ) {\n\t\tthis.dispatch( event );\n\t}\n}\n\nexport default DOMEventSignal;","import DOMEventSignal from './DOMEventSignal';\nimport Node from '../Node';\n\n/**\n * A common interface for all node signals\n */\nexport interface NodeEventCallback {\n\t( node: Node, event:Event )\n}\n\n/**\n * This class registers itself on native DOM events.\n */\nclass NodeSignal extends DOMEventSignal {\n\t\n\tconstructor( public node:Node, event:string ){\n\t\tsuper( node.native, event );\n\t}\n\t\n\tprotected dispatchEvent( event:Event ) {\n\t\tthis.dispatch( this.node, event );\n\t}\n}\n\nexport default NodeSignal;","import NodeSignal from './signal/NodeSignal';\n\n/**\n* #Node\n* \n* Wrapper class for the native HTMLElement node.\n* The class gives generalised access to HTMLElements\n* \n* The node class manages a container from type\n* [HTMLElement](https://developer.mozilla.org/de/docs/Web/API/HTMLElement)\n* and adaptes most common functionality.\n* \n*/\n\nexport class Node {\n\n\t// Properties\n\n\t/**\n\t * The native HTMLElement\n\t */\n\tnative: HTMLElement;\n\n\n\t/**\n\t * All signals\n\t */\n\tscroll: NodeSignal;\n\tmouseleave: NodeSignal;\n\tmouseenter: NodeSignal;\n\tmouseout: NodeSignal;\n\tmouseover: NodeSignal;\n\tmouseup: NodeSignal;\n\tmousedown: NodeSignal;\n\tmousemove: NodeSignal;\n\tclick: NodeSignal;\n\tkeypress: NodeSignal;\n\tkeydown: NodeSignal;\n\tkeyup: NodeSignal;\n\tfocus: NodeSignal;\n\tblur: NodeSignal;\n\tchange: NodeSignal;\n\n\t/**\n\t * Constructs a new node\n\t * \n\t * Dont use the constructor to get/create nodes. Use the Factory methods: Node.fromHTML, Node.fromTag\n\t * \n\t * @param HTMLElement native HTMLElement to wrapp\n\t */\n\tconstructor( native: HTMLElement ) {\n\n\t\tthis.native = native;\n\t\tthis.native[\"_lnNode\"] = this; // inject node instance for later retrieval.\n\n\t\tthis.setupSignals();\n\t}\n\n\t/**\n\t * Static create a node from a HTML string\n\t * or `null` if the string is not valid html\n\t * \n\t * Wrapps the given html string into a new node. If this\n\t * new node has more than on children, return the new node,\n\t * otherwise return the first child.\n\t * \n\t * __Example__\n\t * `var n = Node.fromHTML( '
Demo
' );`\n\t * \n\t * @param html The source for the node\n\t */\n\tstatic fromHTML( html: string ): Node {\n\n\t\t// Wrap the given html string into a new node\n\t\tvar tempDiv = Node.fromTag( 'div' );\n\t\ttempDiv.html = html;\n\n\t\tvar children = tempDiv.children();\n\n\t\t// If there is exactly one child the template has one root node - return this one.\n\t\t// otherwise if there are many or no children return the temp div as the root.\n\t\treturn ( children.length == 1 ) ? children[0] : tempDiv;\n\t}\n\n\t/**\n\t * Static create a new node from a HTML tag\n\t * or `null` if the given tag is invalid\n\t * \n\t * __Example__\n\t * `var n = ln.Node.fromTag( 'div' );`\n\t * \n\t * @param tag\n\t */\n\tstatic fromTag( tag: string ): Node {\n\t\treturn new Node( document.createElement( tag ) );\n\t}\n\n\t/**\n\t * Static function that returns the ln.Node from a native HTMLElement\n\t */\n\tstatic fromNative( native: HTMLElement ): Node {\n\t\tif( native == null ) return null;\n\t\treturn ( native[\"_lnNode\"] ) ? native[\"_lnNode\"] : new Node( native );\n\t}\n\n\t/**\n\t * Gets the value if an HTMLInputElement like an inputfields\n\t */\n\tget value() {\n\t\treturn ( this.native as HTMLInputElement ).value;\n\t}\n\n\t/**\n\t * Sets the value of an HTMLInputElement like an inputfield\n\t */\n\tset value( value: string ) {\n\t\t( this.native as HTMLInputElement ).value = value;\n\t}\n\n\t/**\n\t * Sets the innerHTML with the given html string.\n\t * @param html The HTML-String\n\t */\n\tset html( html: string ) {\n\t\tthis.native.innerHTML = html;\n\t}\n\n\t/**\n\t * Gets the inner html content of the node.\n\t */\n\tget html(): string {\n\t\treturn this.native.innerHTML;\n\t}\n\n\t/**\n\t * Returns the style to directly adjust it.\n\t */\n\tget style(): CSSStyleDeclaration {\n\t\treturn this.native.style;\n\t}\n\n\t/**\n\t * Returns true/false on a checkbox input if its checked or not\n\t */\n\tget checked(): boolean {\n\t\treturn (this.native as HTMLInputElement ).checked;\n\t}\n\tset checked( value:boolean ) {\n\t\t(this.native as HTMLInputElement ).checked = value;\n\t}\n\n\tget data(): any {\n\n\t\t// fallback for older browsers, create dataset object manually\n\t\tif ( this.native.dataset === undefined ) {\n\t\t\tthis.native.dataset = {};\n\t\t\tvar attrs = this.native.attributes;\n\t\t\tfor ( var i = 0; i < attrs.length; i++ ) {\n\t\t\t\tvar attr = attrs[i]\n\t\t\t\tif ( attr.name.substr( 0, 5 ) == \"data-\" ) this.native.dataset[attr.name.substr( 5 )] = attr.value;\n\t\t\t}\n\t\t}\n\n\t\treturn this.native.dataset\n\t}\n\n\t/**\n\t * Returns the full html content of the node.\n\t */\n\ttoString(): string {\n\t\treturn this.native.outerHTML;\n\t}\n\n\n\t/**\n\t * Add new class(es) to the node\n\t * \n\t * Classes are always added distinct\n\t * \n\t * __Example__\n\t * `node.addClass( \"class1\", \"class2\", ... )`\n\t * \n\t * @param classname\n\t * @param classlist Typescript restparameter: A list of optional strings\n\t */\n\taddClass( classname: string, ...classlist: string[] ): void {\n\t\tthis.setClasses( this.getClasses().concat( classlist.concat( classname ) ) );\n\t}\n\n\t/**\n\t * Remove classes from the node\n\t * \n\t * __Example__\n\t * see addClass()\n\t * \n\t * @param classname\n\t * @param classlist typescript restparameter: A list of optional strings\n\t */\n\tremoveClass( classname: string, ...classlist: string[] ): void {\n\n\t\tclasslist.push( classname );\n\n\t\t// return only the ones that are not in the classlist.\n\t\tvar filtered = this.getClasses().filter( function ( value ) {\n\t\t\treturn classlist.indexOf( value ) == -1;\n\t\t});\n\n\t\tthis.setClasses( filtered );\n\t}\n\n\t/**\n\t * Toggle a class from this node\n\t * \n\t * __Example__\n\t * `n.toggleClass( 'class2', true );`\n\t * Would result in `class2` still be set.\n\t * \n\t * @param classname\n\t * @param force When force is set to true, the class is set in any case. \n\t * When force is set to false, the class is removed in any case.\n\t */\n\ttoggleClass( classname: string, force?: boolean ): void {\n\n\t\tif ( force == undefined ) {\n\t\t\t( this.hasClass( classname ) ) ? this.removeClass( classname ) : this.addClass( classname );\n\t\t} else {\n\t\t\t( force ) ? this.addClass( classname ) : this.removeClass( classname );\n\t\t}\n\t}\n\n\t/**\n\t * Get the (distinct) classnames from this node as an array\n\t * \n\t * @return The classes are always distinct\n\t */\n\tprivate getClasses(): string[] {\n\n\t\tvar className:any = this.native.className;\n\t\t\n\t\t// fallback for svg elements\n\t\tif( className instanceof SVGAnimatedString ) className = className.baseVal;\n\n\t\treturn className === \"\" ? [] : className.split( ' ' );\n\t}\n\n\t/**\n\t * Set (distinct) classes to this node\n\t * \n\t * @param classnames\n\t */\n\tprivate setClasses( classnames: string[] ): void {\n\n\t\tvar distinct = classnames.filter( function ( value, index, self ) {\n\t\t\treturn self.indexOf( value ) === index;\n\t\t});\n\n\t\tthis.native.className = distinct.join( ' ' );\n\t}\n\n\t/**\n\t * Check if the classname exists in the classlist of this node\n\t * \n\t * @param classname Classname to be checked\n\t * @return `true` if the class exists, `false` else\n\t */\n\thasClass( classname: string ): boolean {\n\t\treturn this.getClasses().indexOf( classname ) > -1;\n\t}\n\n\t/**\n\t * Sets an attribute to this node\n\t * \n\t * @param name Name of the attribute\n\t * @param value Value of the attribute\n\t */\n\tsetAttribute( name: string, value: string ): void {\n\t\tthis.native.setAttribute( name, value );\n\t}\n\n\t/**\n\t * Gets the value of an attribute of this node\n\t * or `null` if the specified attribute does not exist\n\t * \n\t * @param name Name of the attribute\n\t */\n\tgetAttribute( name: string ): string {\n\t\treturn this.native.getAttribute( name );\n\t}\n\n\t/**\n\t * Append a child node to this node\n\t * \n\t * The node is inserted as last child of this node\n\t * \n\t * @param n Node to append\n\t */\n\tappend( n: Node | DocumentFragment | Node[] ): void {\n\n\t\t// handle array\n\t\tif ( Array.isArray( n ) ) {\n\n\t\t\tn.forEach( node => {\n\t\t\t\tthis.native.appendChild( node.native );\n\t\t\t});\n\n\t\t\treturn;\n\t\t}\n\n\t\t// handle node/fragment\n\t\tthis.native.appendChild(( n instanceof Node ) ? n.native : n );\n\t}\n\n\t/**\n\t * Prepend a child node to this element\n\t * \n\t * The node is inserted as first child of this node\n\t * \n\t * @param n Node to prepend \n\t */\n\tprepend( n: Node | DocumentFragment | Node[] ): void {\n\n\t\tvar firstChild = this.native.firstChild;\n\n\t\t// handle array\n\t\tif ( Array.isArray( n ) ) {\n\n\t\t\tn.forEach( node => {\n\t\t\t\tthis.native.insertBefore( node.native, firstChild );\n\t\t\t});\n\n\t\t\treturn;\n\t\t}\n\n\t\t// handle node/fragment\n\t\tthis.native.insertBefore(( n instanceof Node ) ? n.native : n, firstChild );\n\t}\n\n\t/** \n\t * Inserts a child node before a given node\n\t * \n\t * @param newNode Node to be inserted\n\t * @param index Position at which the node will be inserted.\n\t */\n\tinsert( n: Node | DocumentFragment, index: number = undefined ): void {\n\t\tthis.native.insertBefore(( n instanceof Node ) ? n.native : n, this.native.childNodes[index] || null );\n\t}\n\n\t/**\n\t * Replaces this node in its parent with the given new node\n\t */\n\treplace( n: Node ): void {\n\t\tthis.parent().native.replaceChild( n.native, this.native );\n\t}\n\n\t/**\n\t * Get all the child nodes from this element\n\t * which are HTMLElements ( no comments, no text, no HTMLDocuments )\n\t * and return them as a array of nodes.\n\t * \n\t * @return Array of child nodes\n\t * or an empty array if the node has no child nodes\n\t */\n\tchildren(): Node[] {\n\t\treturn this.toNodes( this.native.children );\n\t}\n\n\t/**\n\t * Checks if this node has child nodes ( child elements )\n\t * \n\t * @return `true` if this node has child nodes, `false` else\n\t */\n\thasChildren(): boolean {\n\t\treturn this.native.children.length !== 0;\n\t}\n\n\t/**\n\t * Checks if the node has the given node as child node\n\t * \n\t * @return `true` if this node has the given node as child, `false` else\n\t */\n\thasChild( n: Node ): boolean {\n\t\treturn this.children().some( function ( node ) {\n\t\t\treturn node === n;\n\t\t});\n\t}\n\n\t/**\n\t * Removes specified child node and returns the node\n\t * \n\t * @param child Child node to remove from this node\n\t * \n\t * Throws an exception if child is actually is not a child\n\t * of this node\n\t */\n\tremoveChild( child: Node ) {\n\t\tthis.native.removeChild( child.native );\n\t}\n\n\t/**\n\t * removes this node from the parent\n\t */\n\tremove() {\n\t\tif ( this.native.parentElement ) {\n\t\t\tthis.native.parentElement.removeChild( this.native );\n\t\t}\n\t}\n\n\t/**\n\t * Removes all children\n\t */\n\tempty() {\n\t\tfor ( var i = this.native.children.length; i--; ) {\n\t\t\tthis.native.removeChild( this.native.children[i] );\n\t\t}\n\t}\n\n\t/**\n\t * Returns the parent HTMLElement from this node\n\t * \n\t * @return The parent node of this node\n\t * or null if this node has no parent\n\t */\n\tparent(): Node {\n\n\t\tvar p = this.native.parentElement;\n\t\tif ( p === null ) return null;\n\n\t\treturn Node.fromNative( p );\n\t}\n\n\t/**\n\t * Returns the bounding box of this node including values for top, bottom, left, right\n\t * @param relative A flag that specifies if the bounding box coordinates should be relative to the viewport.\n\t */\n\tbounds( relative: boolean = false ): { top: number; left: number; right: number; bottom: number; height: number; width: number  } {\n\n\t\tvar c = this.native.getBoundingClientRect();\n\t\tvar r = {  top: c.top, left: c.left, right: c.right, bottom: c.bottom, height: c.height, width: c.width };\n\n\t\tif ( !relative ) {\n\t\t\tr.top += document.body.scrollTop || document.documentElement.scrollTop;\n\t\t\tr.bottom += document.body.scrollTop || document.documentElement.scrollTop;\n\t\t\tr.left += document.body.scrollLeft || document.documentElement.scrollLeft;\n\t\t\tr.right += document.body.scrollLeft || document.documentElement.scrollLeft;\n\t\t}\n\n\t\tif ( r.height == undefined ) r.height = r.bottom - r.top;\n\t\tif ( r.width == undefined ) r.width = r.right - r.left;\n\n\t\treturn r;\n\t}\n\n\t/**\n\t * Returns the computed css style.\n\t */\n\tcss( property ) {\n\t\treturn ( this.native.currentStyle ) ? this.native.currentStyle[ property ] : document.defaultView.getComputedStyle( this.native, null ).getPropertyValue( property );\n\t}\n\n\t/**\n\t * Queries this node for the first child node by the specified selector\n\t * and returns it without removing it\n\t * \n\t * @param selector A CSS selector\n\t * @return The first node with the specified selector or `null` if a matching node was not found\n\t * \n\t * Throws a SYNTAX_ERR exception if the specified selector is invalid.\n\t */\n\tone( selector: string ): Node {\n\n\t\tvar htmlElement = this.native.querySelector( selector );\n\n\t\tif ( htmlElement !== null ) {\n\t\t\treturn Node.fromNative( htmlElement );\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Queries this node for all the child nodes by the specified selector\n\t * and returns them as an array\n\t * \n\t * @param selector A CSS selector\n\t * @return Array of nodes (An empty array if there are no elements with\n\t * the specified selector )\n\t * \n\t * Throws a SYNTAX_ERR exception if the specified selector is invalid.\n\t */\n\tall( selector: string ): Node[] {\n\t\treturn this.toNodes( this.native.querySelectorAll( selector ) );\n\t}\n\n\t/**\n\t * Helper function for getting nodes with a js attribute from within the node.\n\t * Gets only the first node\n\t * \n\t * @param key A key used to build the CSS selector [js=key] \n\t * @return The first node or `null` if no matching node was found\n\t */\n\tjs( key: string ): Node {\n\t\treturn this.one( '[js=' + key + ']' );\n\t}\n\n\t/**\n\t * Queries the document for the first node by the specified selector\n\t * and returns it\n\t * \n\t * @param selector A CSS selector\n\t * @return The first node with the specified selector or `null` if a matching node was not found\n\t * \n\t * Throws a SYNTAX_ERR exception if the specified selector is invalid.\n\t */\n\tstatic one( selector: string ): Node {\n\t\tvar tempNode = new Node( document.body );\n\t\treturn tempNode.one( selector );\n\t}\n\n\t/**\n\t * Queries the document for all the nodes by the specified selector\n\t * and returns them as an array\n\t * \n\t * @param selector A CSS selector\n\t * @return Array of nodes or an emtpy array if there are no elements\n\t * with the specified selector\n\t * \n\t * Throws a SYNTAX_ERR exception if the specified selector is invalid.\n\t */\n\tstatic all( selector: string ): Node[] {\n\t\tvar tempNode = new Node( document.body );\n\t\treturn tempNode.all( selector );\n\t}\n\n\t/**\n\t * Helper function for getting nodes with a js attribute from the document.\n\t * Gets only the first occurence.\n\t * \n\t * @param key A key used to build the CSS selector [js-node=key] \n\t * @return The first node or `null` if no matching node was found\n\t */\n\tstatic js( key: string ): Node {\n\t\tvar tempNode = new Node( document.body );\n\t\treturn tempNode.js( key );\n\t}\n\n\tstatic get body():Node {\n\t\treturn Node.fromNative( document.body );\n\t}\n\n\t/**\n\t * Helper function that setups all signals properly\n\t */\n\tprivate setupSignals() {\n\t\tvar events = ['scroll',\n\t\t\t'mouseleave',\n\t\t\t'mouseenter',\n\t\t\t'mouseout',\n\t\t\t'mouseover',\n\t\t\t'mouseup',\n\t\t\t'mousedown',\n\t\t\t'mousemove',\n\t\t\t'click',\n\t\t\t'keypress',\n\t\t\t'keydown',\n\t\t\t'keyup',\n\t\t\t'focus',\n\t\t\t'blur',\n\t\t\t'change'];\n\n\t\tfor ( var i = 0; i < events.length; i++ ) {\n\t\t\tthis[events[i]] = new NodeSignal( this, events[i] );\n\t\t}\n\t}\n\n\t/**\n\t * Turns a string into a document fragment\n\t */\n\tpublic static fragment( html: string ): DocumentFragment {\n\n\t\t// browser check if its available\n\t\ttry {\n\t\t\treturn document.createRange().createContextualFragment( html );\n\t\t} catch ( e ) {\n\n\t\t\t// for older browsers make temp document and loop over nodes\n\t\t\tvar frag = document.createDocumentFragment(),\n\t\t\t\tbody = document.createElement( 'body' ), c;\n\t\t\tbody.innerHTML = html;\n\n\t\t\twhile ( c = body.firstElementChild ) frag.appendChild( c );\n\n\t\t\treturn frag;\n\t\t}\n\t}\n\n\t/**\n\t * Helper to turn a HTML Collection or any list into an array of nodes\n\t */\n\tprivate toNodes( collection: any ): Node[] {\n\n\t\tvar temp = [];\n\n\t\tfor ( var i = 0; i < collection.length; i++ ) {\n\t\t\tif ( collection[i] instanceof Element ) {\n\t\t\t\ttemp.push( Node.fromNative( collection[i] ) );\n\t\t\t}\n\t\t}\n\n\t\treturn temp;\n\t}\n}\n\nexport default Node;\n\n\n\n","\n/**\n * An interface for any source for the LookupDict\n */\nexport interface LookupSource {\n\tlookup( key:string ):any;\n}\n\n\n/**\n\t* This class provides a key:value lookup mechanism where multiple sources can be added.\n\t*/\nclass LookupDict {\n\t\n\tprivate sources:LookupSource[] = [];\n\t\n\t/**\n\t\t* Adds a new source to the dictionary to search for keys\n\t\t*/\n\tadd( source:LookupSource ) {\n\t\tthis.sources.push( source );\n\t}\n\t\n\t\n\t/**\n\t\t* Returns the value stored behind the given key in the first of all sources\n\t\t*/\n\tget( key:string, fallback?:string ):any {\n\t\t\n\t\tvar result, i, s = this.sources;\n\n\t\t// loop over sources to find key.\n\t\tfor( i = 0; i < s.length; i++ ) {\n\t\t\tresult = s[ i ].lookup( key );\n\t\t\tif( result != null ) return result;\n\t\t}\n\t\t\n\t\t// if fallback is provided show that\n\t\tif( fallback !== undefined ) return fallback;\n\t\t\n\t\t// not found\n\t\treturn '!{' + key + '}'; \n\t}\n}\n\n\n\nexport default LookupDict;","import { LookupSource } from './LookupDict';\nimport { isType } from '../js';\n\n/**\n\t* A lookup dictionary source that searches on an object for given keys.\n\t* It allows to search in nested objects too.\n\t*/\nclass LookupObject implements LookupSource {\n\t\n\tprivate obj:Object;\n\n\tconstructor( obj:Object ) {\n\t\tthis.obj = ( isType( obj, 'Object' ) ) ? obj : {};\n\t}\n\t\n\t/**\n\t\t* lookups in the object for the given key.\n\t\t*/\n\tlookup( key:string ):any {\n\t\tvar keys = key.split( '.' );\n\t\treturn this.search( this.obj, keys );\n\t}\n\t\n\t/**\n\t\t* Adds a prefix to the search keys on this object\n\t\t*/\n\tprefix( name:string ):void {\n\t\tvar temp = {};\n\t\ttemp[ name ] = this.obj;\n\t\tthis.obj = temp;\n\t}\n\t\n\t/**\n\t\t* Searches in the given object for the first key in the keys array.\n\t\t* If there are sub keys it digs deeper into object hierarchy.\n\t\t*/\n\tprivate search = function( current:Object, keys:string[] ) {\n\t\t\n\t\tvar top = keys.shift();\n\t\t\n\t\t// there are sub keys to search\n\t\tif( keys.length > 0 ) {\n\t\t\treturn ( current[ top ] != undefined ) ? this.search( current[ top ], keys ) : undefined;\n\t\t} else {\n\t\t\treturn current[ top ];\n\t\t}\n\t};\n}\n\nexport default LookupObject;","/**\n * A collection of js specific helper functions.\n */\n\ntype baseTypes = \"Array\" | \"Object\" | \"String\" | \"Date\" | \"RegExp\" | \"Function\" | \"Boolean\" | \"Number\" | \"Null\" | \"Undefined\";\n\n/**\n * Helper function that checks if the given input is any of the given types \n */\nexport function isType( input:any, checkOn:baseTypes | Array ):boolean {\n\n\t// catch single string input\n\tvar types:Array = ( !Array.isArray( checkOn ) ) ? [ checkOn ] : checkOn;\n\n\t// test on object.\n\tif( types.indexOf( \"Object\" ) >= 0 ) {\n\t\tvar match = input && input.constructor == Object;\n\t\tif( match ) return match;\n\n\t\ttypes.splice( types.indexOf( \"Object\" ), 1 );\n\t}\n\n\t// test anything else\n\tvar inputType = Object.prototype.toString.call( input ).slice(8, -1);\n\treturn types.indexOf( inputType ) >= 0;\n}\n\n\n/**\n * This function applies multiple mixins to the given extendedClass.\n */\nexport function mixin( extendedClass: any, mixins: any[] ) {\n mixins.forEach( baseCtor => {\n Object.getOwnPropertyNames( baseCtor.prototype ).forEach( name => {\n extendedClass.prototype[name] = baseCtor.prototype[name];\n });\n }); \n}\n\n/**\n * Merges multiple objects into one. No deep clone.\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n */\nexport function assign( target:{} = {}, ...args:Object[] ) {\n\n\tvar copy = Object( target );\n\n\targs.forEach( ( source ) => {\n\t\tif( source ) {\n\t\t\tfor( var nextKey in source ) {\n\t\t\t\tif( source.hasOwnProperty( nextKey ) ) copy[ nextKey ] = source[ nextKey ];\n\t\t\t}\n\t\t}\n\t});\n\n\treturn copy;\n}\n\n\n/**\n * Adapted from: http://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array\n */\nexport function shuffle(array) {\n var i = array.length, t, randomIndex;\n // While there remain elements to shuffle...\n while (0 !== i) {\n // Pick a remaining element...\n randomIndex = Math.floor(Math.random() * i);\n i -= 1;\n // And swap it with the current element.\n t = array[i];\n array[i] = array[randomIndex];\n array[randomIndex] = t;\n }\n return array;\n}","\n/**\n* An interface of the complied template function containing also its source\n*/\ninterface CompliedTemplate {\n ( data:any ):string;\n source:string;\n}\n\ninterface TemplatePass {\n regex:RegExp;\n mapper:( match:string, inner:string ) => string;\n}\n\n\n/**\n* This class adapts the template implementation of the underscore library:\n* https://github.com/jashkenas/underscore\n*/\nclass TemplateRenderer {\n \n public passes:TemplatePass[] = [];\n public context:any = { };\n \n \n constructor() {\n \n // inject escape function\n this.context.esc = this.escape;\n this.context.empty = this.empty;\n this.context.url = encodeURIComponent;\n\n this.passes = this.defaultPasses();\n }\n \n /**\n * Renders the given data into the given template string\n */\n render( template:string, data:any = {} ):string {\n return this.compile( template )( data );\n }\n \n /**\n * Compiles a template string into a template function.\n */\n compile( templateString:string ):CompliedTemplate {\n \n var source:string = this.parse( templateString );\n var render = new Function( 'data', source );\n var contx = this.context;\n \n // wrap function to adjust context\n var template = function( data ):string {\n return render.call( contx, data );\n }\n \n template.source = source;\n return template;\n }\n \n /**\n * Turns the given template into a function body code.\n */\n parse( template:string ):string {\n \n template = this.sanitize( template );\n \n // loop over all passes\n this.passes.forEach( function( pass ) {\n template = template.replace( pass.regex, pass.mapper );\n });\n \n // finalize full template instructions\n template = \"__t='\" + template + \"';\\n\";\n \n // adjust scope with 'with'\n template = 'with( data ) {\\n' + template + '}\\n';\n \n // add opt variable for optional access\n return 'var __t;\\nvar opt = data;\\nvar __c = this;' + template + 'return __t;'\n }\n \n /**\n * Escapes the given string with html entities\n */\n escape( text:string ):string {\n var reg:RegExp = /[&<>\"'\\/`]/g;\n var lookup = { '&': '&', '<': '<', '>': '>', '\"': '"', \"'\": ''', '/': '/', '`': '`' };\n text = text + ''; // make string.\n return text.replace( reg, function( match:string ) {\n return lookup[ match ];\n });\n }\n \n /**\n * Tests if the value of the template is empty or not\n */\n empty( data:any ):string {\n return data || data === 0 ? data : '';\n }\n \n /**\n * Sanitizes the given string to avoid escaping of the source\n */\n sanitize( text:string ):string {\n var reg:RegExp = /'|\\\\|\\r|\\n|\\u2028|\\u2029/g;\n var lookup = { \"'\": \"\\\\'\", '\\\\': '\\\\\\\\', '\\r': '\\\\r', '\\n': '\\\\n', '\\u2028': '\\\\u2028', '\\u2029': '\\\\u2029' };\n return text.replace( reg, function( match:string ) {\n return lookup[ match ];\n });\n }\n \n /**\n * Reverts the sanitizes escapes\n */\n unsanitize( text:string ):string {\n var reg:RegExp = /\\\\\\\\|\\\\'|\\\\r|\\\\n|\\\\u2028|\\\\u2029/g;\n var lookup = { '\\\\\\\\': '\\\\', \"\\\\'\": \"'\", '\\\\r': '\\r', '\\\\n': '\\n', '\\\\u2028': '\\u2028', '\\\\u2029': '\\u2029' };\n return text.replace( reg, function( match:string ) {\n return lookup[ match ];\n });\n }\n \n /**\n * Returns the array of default template render passes\n * Most specific match has to be the first.\n */\n defaultPasses():TemplatePass[] {\n \n var revert = this.unsanitize;\n \n return [\n {\n regex:/\\[\\[=([\\s\\S]+?)\\]\\]/g,\n mapper: function( match, inner ) {\n return \"' + __c.empty( \" + revert( inner ) + \" ) + '\";\n }\n },\n {\n regex:/\\[\\[([\\s\\S]+?)\\]\\]/g,\n mapper: function( match, inner ) {\n return \"' + __c.esc( __c.empty( \" + revert( inner ) + \" ) ) + '\";\n }\n },\n {\n regex:/\\[%([\\s\\S]+?)%\\]/g,\n mapper: function( match, inner ) {\n return \"';\\n\" + revert( inner ) + \"\\n__t+='\";\n }\n }\n ]\n }\n}\n\nexport default TemplateRenderer;","import LookupDict from '../lookup/LookupDict';\nimport LookupObject from '../lookup/LookupObject';\nimport TemplateRenderer from './TemplateRenderer';\nimport Lang from '../lang/Lang';\nimport Node from '../node/Node';\n\n/**\n\t* This class manages template from different sources.\n\t* It will look up for templates in the stored sources and renders them with a TemplateRenderer.\n\t* For performance the manager keeps cached versions of looked up templates.\n\t*/\nclass TemplateManager {\n\t\n\tprivate cache:any = {};\n\tprivate lookup:LookupDict;\n\tpublic renderer:TemplateRenderer;\t\n\n\tconstructor() {\n\t\tthis.renderer = new TemplateRenderer();\n\t\tthis.lookup = new LookupDict();\n\t}\n\t\n\t/**\n\t* Renders the template with the given key with the given data into a string. \n\t*/\n\tpublic render( keyOrTemplate:string, data:any = {} ):string {\n\t\t\n\t\tif( this.cache[ keyOrTemplate ] == undefined ) {\n\t\t\tthis.cache[ keyOrTemplate ] = this.renderer.compile( this.lookup.get( keyOrTemplate, keyOrTemplate ) );\n\t\t}\n\t\t\n\t\treturn this.cache[ keyOrTemplate ]( data );\n\t}\n\n\n\t/**\n\t * Renders the template into a document fragment\n\t */\n\tpublic document( key:string, data:any = {} ):DocumentFragment {\n\t\treturn Node.fragment( this.render( key, data ) );\n\t}\n\t\n\tpublic get context():any {\n\t\treturn this.renderer.context;\n\t}\n\n\t/**\n\t * Adds a template lookup object\n\t * @param obj \n\t */\n\tpublic add( obj:Object ) {\n\t\tthis.lookup.add( new LookupObject( obj ) );\n\t}\n}\n\n// create singleton to export.\nvar singleton = new TemplateManager();\n\n/**\n * Add import function to TemplateRenderer context\n */\nsingleton.renderer.context[\"import\"] = function( key:string, data?:any ) {\n\treturn singleton.render( key, data );\n}\n\n\nexport default singleton;","import LookupDict from '../lookup/LookupDict';\nimport LookupObject from '../lookup/LookupObject';\nimport Template from '../template/TemplateManager';\n\t\n/**\n\t* A class that handles translation lookups\n\t*/\nclass Language {\n\t\n\t\n\tprivate lookup:LookupDict;\n\t\n\tconstructor() {\n\t\tthis.lookup = new LookupDict();\n\t}\n\t\n\t/**\n\t\t* translates the given key.\n\t\t*/\n\ttranslate( key:string, opts:{ data?:any, condition?:number } = {} ):any {\n\t\tif( key == undefined ) return '';\n\t\tvar def = this.lookup.get( key, key );\n\t\tif( opts.condition != undefined ) def = this.matchCondition( def, opts.condition );\n\t\tif( opts.data ) def = Template.render( def, opts.data );\n\t\treturn def;\n\t}\n\n\tmatchCondition( value:string, num:number ) {\n\n\t\tvar parts = value.split( '|' );\n\n\t\t// check conditions\n\t\tvar found = this.parseConditions( parts, num )\n\t\tif( found ) return found.trim();\n\n\t\tif( parts.length == 1 ) return this.clearConditions( parts[0] );\n\t\t\n\t\t// check simple | split\n\t\treturn this.clearConditions( parts[ ( num == 1 ) ? 0 : 1 ] );\n\t}\n\t\n\tparseConditions( parts, number:number ):string {\n\t\t// loop over parts\n\t\tfor( var i = 0; i < parts.length; i++ ) {\n\t\t\tvar regex = /^[\\{\\[]([^\\[\\]\\{\\}]*)[\\}\\]](.*)/;\n\t\t\tvar match = regex.exec( parts[i] );\n\n\t\t\t// no proper condition\n\t\t\tif( match == null || match.length != 3 ) continue;\n\n\t\t\tvar value = match[2];\n\t\t\tvar condition = match[1];\n\t\t\tvar num = number + \"\"; // turn into string for matching\n\n\t\t\t// range condition\n\t\t\tif( condition.indexOf( ',' ) > -1 ) {\n\n\t\t\t\tvar [ from, to ] = condition.split( ',' );\n\n\t\t\t\tif ( to == '*' && num >= from ) {\n\t\t\t\t\treturn value;\n\t\t\t\t} else if ( from == '*' && num <= to ) {\n\t\t\t\t\treturn value;\n\t\t\t\t} else if ( num >= from && num <= to ) {\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\n\t\t\t// exact condition\n\t\t\t} else if( condition == num ) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t}\n\n\tclearConditions( s:string ):string {\n\t\treturn s.replace( /^[\\{\\[]([^\\[\\]\\{\\}]*)[\\}\\]]/, '' ).trim();\n\t}\n\n\tadd( object:Object ) {\n\t\tthis.lookup.add( new LookupObject( object ) );\n\t}\n}\n\n/**\n * Define singleton for Language\n */\nvar singleton = new Language();\n\n/**\n * Add translation into context\n */\nTemplate.context.trans = singleton.translate.bind( singleton );\n\nexport default singleton;\n","import \"es6-promise/auto\";\nimport Signal from '../signal/Signal';\n\n\ninterface ProgressSignal {\n\t( loaded:number, total:number )\n}\n\n/**\n * HttpRequest Class\n */\n\nexport class HttpRequest {\n\t\n\tprotected _method:string = 'GET';\n\tprotected _url:string;\n\tprotected _headers:{} = null;\n\tprotected request:XMLHttpRequest;\n\n\tpublic progress:Signal = new Signal();\n\t\n\t\n\t/**\n\t * Create a new instance with the given url\n\t * @param url\n\t */\n\tconstructor( url:string ) {\n\t\tthis._url = url;\n\n\t\tthis.request = new XMLHttpRequest();\n\t\tthis.request.onprogress = ( event ) => {\n\t\t\tthis.progress.dispatch( event.loaded, event.total );\n\t\t}\n\t}\n\t\n\t/**\n\t * Set the method for the request\n\t * @param method\n\t */\n\tpublic method( method:string ):HttpRequest {\n\t\tthis._method = method;\n\t\treturn this;\n\t}\n\t\n\t/**\n\t * Set the headers for the request\n\t * @param headers\n\t */\n\tpublic headers( headers:{} ):HttpRequest {\n\t\tthis._headers = headers;\n\t\treturn this\n\t}\n\t\n\t/**\n\t * Send/Load the request without sending data\n\t */\n\tpublic load():Promise {\n\t\treturn this.sendRequest().then( this.parseJson );\n\t}\n\t\n\t/**\n\t * Send the request with the given data\n\t * @param data\n\t */\n\tpublic send( data:any ):Promise {\n\t\treturn this.sendRequest( data ).then( this.parseJson );\n\t}\n\n\tpublic url():string {\n\t\treturn this._url;\n\t}\n\t\n\t/**\n\t * Open and send the request with the given parameters\n\t * and data\n\t * @param data\n\t */\n\tprivate sendRequest( data:any = null ):Promise {\n\t\t\n\t\tvar request = this.request;\n\t\tvar promise = this.promise( request );\n\t\t\n\t\trequest.open( this._method, this._url );\n\t\t\n\t\tfor( var key in this._headers ){\n\t\t\trequest.setRequestHeader( key, this._headers[key] );\n\t\t}\n\t\t\n\t\trequest.send( data );\n\t\t\n\t\treturn promise;\n\t}\n\t\n\t/**\n\t * Create a promise with the request\n\t * The promise resolves in case of a successful request - jejects otherwise\n\t */\n\tprivate promise( request:XMLHttpRequest ) {\n\t\treturn new Promise( ( resolve, reject ) => {\n\t\t\t\n\t\t\tvar errorHandler = function() {\n\t\t\t\tRequest.error.dispatch( request.statusText );\n\t\t\t\treject( Error( request.statusText ) );\n\t\t\t}\n\t\t\t\n\t\t\trequest.onload = function() {\n\t\t\t\tif( request.status >= 200 && request.status < 300 ) {\n\t\t\t\t\tresolve( request.responseText );\n\t\t\t\t} else {\n\t\t\t\t\terrorHandler();\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\trequest.onerror = errorHandler;\n\t\t});\n\t}\n\n\t/**\n\t * tries to parse response otherwise returns original string data\n\t */\n\tprivate parseJson( data:string ):string|{} {\n\t\ttry {\n\t\t\tdata = JSON.parse( data )\n\t\t\treturn data;\n\t\t} catch( e ) {\n\t\t\treturn data;\n\t\t}\n\t}\n}\n\ninterface ErrorSignal {\n\t( error:string )\n}\n\n/**\n * Static Request Class\n */\nexport class Request {\n\t\n\tpublic static error:Signal = new Signal();\n\t/**\n\t * Creates a new post HttpRequest\n\t */\n\tpublic static post( url:string ):HttpRequest{\n\t\treturn new HttpRequest( url ).method( 'POST' );\n\t}\n\t\n\t/**\n\t * Creates a new get HttpRequest\n\t */\n\tpublic static get( url:string ):HttpRequest{\n\t\treturn new HttpRequest( url ).method( 'GET' );\n\t}\n\t\n\t/**\n\t * Creates a new put HttpRequest\n\t */\n\tpublic static put( url:string ):HttpRequest{\n\t\treturn new HttpRequest( url ).method( 'PUT' );\n\t}\n\t\n\t/**\n\t * Creates a new delete HttpRequest\n\t */\n\tpublic static delete( url:string ):HttpRequest{\n\t\treturn new HttpRequest( url ).method( 'DELETE' );\n\t}\n}\n\n\nexport default Request;","\nexport interface AssetConfig {\n\turl: string,\n\ttype?: \"js\" | \"css\",\n}\n\nexport class Asset {\n\n\t// store which assets are already loaded.\n\tstatic promises:{ [index:string]: Promise } = {};\n\n\tconfig:AssetConfig;\n\n\n\tconstructor( config:AssetConfig ) {\n\t\tif( !config.type ) config.type = this.guessType( config.url );\n\t\tthis.config = config;\n\t}\n\n\n\tload():Promise {\n\n\t\t// if not loaded create promise\n\t\tif( !Asset.promises[ this.config.url ] ) {\n\t\t\t( this.config.type == \"js\" ) ? this.loadScript() : this.loadCSS();\n\t\t}\n\n\t\treturn Asset.promises[ this.config.url ];\n\t}\n\n\t/**\n\t * Loads a js file into dom\n\t */\n\tprivate loadScript() {\n\n\t\tvar url = this.config.url;\n\n\t\tAsset.promises[ url ] = new Promise( function( resolve, reject ) {\n\t\t\tvar element = document.createElement( 'script' );\n\t\t\telement.src = url;\n\t\t\telement.addEventListener( 'load', resolve );\n\t\t\telement.addEventListener( 'error', reject );\n\t\t\tdocument.body.appendChild( element );\n\t\t}).then( function( event:Event ) {\n\t\t\tthis.finalize( url );\n\t\t\treturn event;\n\t\t}.bind( this ));\n\t}\n\n\t/**\n\t * Loads a css file into the dom\n\t */\n\tprivate loadCSS() {\n\n\t\tvar url = this.config.url;\n\n\t\tAsset.promises[ url ] = new Promise( function( resolve, reject ) {\n\t\t\tvar element = document.createElement( 'link' );\n\t\t\telement.type = 'text/css';\n element.rel = 'stylesheet';\n\t\t\telement.href = url;\n\t\t\telement.addEventListener( 'load', resolve );\n\t\t\telement.addEventListener( 'error', reject );\n\t\t\tdocument.head.appendChild( element );\n\t\t}).then( function( event:Event ) {\n\t\t\tthis.finalize( url );\n\t\t\treturn event;\n\t\t}.bind( this ));\n\t}\n\n\tprivate finalize( url:string ) {\n\t\tAsset[ url ] = new Promise( function( resolve, reject ) { resolve() } );\n\t}\n\n\t/**\n\t * Guesses the type based on the given url\n\t */\n\tprivate guessType( url:string ):\"js\"|\"css\" {\n\n\t\tif( url.split('.').pop() == \"js\" ) return \"js\";\n\t\tif( url.split('.').pop() == \"css\" ) return \"css\";\n\n\t\treturn \"js\";\n\t} \n}\n\nexport default Asset;","import LookupDict from '../lookup/LookupDict';\nimport LookupObject from '../lookup/LookupObject';\nimport { HttpRequest } from '../request/Request';\nimport Template from '../template/TemplateManager';\nimport Asset from './Asset';\n\nexport interface SetupConfig {\n\troutes:any,\n\tdata:any,\n\tassets:any,\n}\n\n/**\n * A class that manages external routes, data and assets.\n */\nexport class Setup {\n\n\tprivate lookup:LookupDict;\n\n\tconstructor() {\n\t\tthis.lookup = new LookupDict();\n\t}\n\n\tinit( data:SetupConfig ) {\n\t\tthis.lookup.add( new LookupObject( data ) );\n\t\tTemplate.context.setup = this;\n\t}\n\n\t/**\n\t * Returns a request that can load an save data to the url defined in the configuration\n\t * @param key The key under the routes definition\n\t * @param urlParams The parameters for the url\n\t */\n\troute( key:string, urlParams:{} = {} ):HttpRequest {\n\n\t\tvar config = this.search( \"routes.\" + key );\n\t\tvar url = Template.render( config.url, urlParams );\n\t\tvar request = new HttpRequest( url );\n\n\t\tif( config.method ) request.method( config.method );\n\t\tif( config.headers ) request.headers( config.headers );\n\t\t\n\t\treturn request;\n\t}\n\n\t/**\n\t * Returns any data that is defined under the data configuration\n\t */\n\tdata( key?:string ):any {\n\t\tif( key === undefined ) return this.search( 'data' );\n\t\treturn this.search( \"data.\" + key );\n\t}\n\n\t/**\n\t * Returns a asset loader that can load additional scripts and css files.\n\t */\n\tasset( key:string ):Asset {\n\t\treturn new Asset( this.search( \"assets.\" + key ) );\n\t}\n\n\tprivate search( key ):any {\n\t\tvar config = this.lookup.get( key, null );\n\t\tif( !config ) throw new Error( \"Could not find defintion for api with key: \" + key );\n\t\treturn config;\n\t}\n}\n\n\nvar setup = new Setup();\nexport default setup;","import Node from '../node/Node';\nimport { scanner } from './Scanner';\nimport Template from '../template/TemplateManager';\n\n/**\n * A common view class that has a container to render content/template into.\n */\nclass View {\n\n\tpublic data:any\n\tpublic node:Node;\n\n\t// keep this for backward compatibility\n\tpublic defaultTemplate:string = \"\";\n\n\n\tconstructor( data:any = {} ) {\n\t\tthis.data = data;\n\t}\n\t\n\t\n\t/**\n\t * Renders either the given template as a node.\n\t * Or simply sets the given node.\n\t */\n\tpublic render( target?:Node ):View {\n\n\t\t// is there a target node given\n\t\tif( target instanceof Node ) {\n\t\t\tthis.node = target;\n\n\t\t\t// check if empty node - render template\n\t\t\tif( target.html == \"\" ) {\n\t\t\t\tvar temp = this.renderTemplate();\n\t\t\t\tthis.node.html = temp.html; // set only inner html\n\n\t\t\t\t// set css if there is no style defined on target\n\t\t\t\tif( !this.node.getAttribute( 'class' ) ) this.node.setAttribute( 'class', temp.getAttribute( 'class' ) );\n\t\t\t}\n\n\t\t} else {\n\t\t\tthis.node = this.renderTemplate();\n\t\t}\n\n\t\tthis.init();\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * The function is called when rendering is done and the node is available.\n\t * Usefull for subclasses to initialize after the node is ready. \n\t */\n\tprotected init() {\n\t\t// do in subclass.\n\t}\n\n\t/**\n\t * This function returns the data that should be rendered into the template\n\t */\n\tprotected renderData():any {\n\t\treturn this.data;\n\t}\n\n\tprotected renderTemplate():Node {\n\n\t\t// for backward compatibility\n\t\tif( !this.data.template ) this.data.template = this.defaultTemplate;\n\n\t\treturn Node.fromHTML( Template.render( this.data.template, this.renderData() ) );\n\t}\n\n}\n\nexport default View;","/**\n\t* A class to register closure functions under a given key\n\t* ...\n\t*/\nclass IoC{\n\t\n\tprivate map:{ [index:string]: T };\n\t\n\tconstructor(){\n\t\tthis.map = {};\n\t}\n\t\n\t/**\n\t* Registers the given closure under the given key\n\t* @param key The key to register the closure\n\t* @param closure The closure function\n\t*/\n\tpublic add( key:string, closure:T ){\n\t\tthis.map[ key ] = closure;\n\t}\n\t\n\t/**\n\t* Returns the registered closure under the given key\n\t* @param key The key of registerd closure to look for\n\t* @return The closure under the given key or undefined, if\n\t* the key does not exist\n\t*/\n\tpublic get( key:string ):T{\n\t\tvar tmp = this.map[ key ];\n\t\ttmp = ( tmp ) ? tmp : this.map[ 'default' ];\n\n\t\tif( !tmp ) throw new Error( \"No key with name: '\" + key + \"' is registered and no default fallback is defined on ioc.\" );\n\t\t\n\t\treturn tmp;\n\t}\n\t\n\t/**\n\t* Returns this key is registered allready\n\t* @param key The key to check if it is registered allready\n\t*/\n\tpublic has( key:string ):boolean{\n\t\treturn this.map[ key ] != undefined;\n\t}\n\t\n\t/**\n\t* Returns all registered keys\n\t* @return Array of all the registered keys\n\t*/\n\tpublic keys():string[] {\n\t\treturn Object.keys( this.map );\n\t}\n\n\t/**\n\t * Creates an alias for an already registered closure\n\t * @param newName The alias name\n\t * @param oldName The name of the already registered function\n\t */\n\tpublic alias( newName:string, oldName:string ) {\n\t\tthis.map[ newName ] = this.map[ oldName ];\n\t}\n\n\t/**\n\t * Renames an already registered closure to a new name\n\t * @param newName The new name \n\t * @param oldName The old registered name \n\t */\n\tpublic rename( newName:string, oldName:string ) {\n\t\tthis.alias( newName, oldName );\n\t\tdelete this.map[ oldName ];\n\t}\n}\n\nexport default IoC;","import IoC from '../ioc/IoC';\nimport Node from '../node/Node';\nimport View from './View';\n\n\nexport interface FactoryFunction {\n\t( node:Node, data?:any ):View;\n}\n\n\n/**\n * This class scans over a html document for views to instantiate and render.\n */\nexport class Scanner {\n\n\tpublic ioc:IoC = new IoC();\n\n\t/**\n\t * Runs the scanner for all registered keys in the ioc.\n\t * @param root The root node where the scanner should search\n\t * @param data The data that is passed to the ioc function\n\t * @param order An optional order to make sure the scanner initializes in the correct order.\n\t */\n\tscan( root:Node, data:any = undefined, order:string[] = [] ):void {\n\n\t\t// sort keys based on given order\n\t\tvar keys = order.concat( this.ioc.keys() );\n\n\t\t// make sure keys are unique\n\t\tkeys = keys.filter( function( value, index, self ) { \n\t\t\treturn self.indexOf( value ) === index;\n\t\t});\n\n\t\t// get all registered keys.\n\t\tkeys.forEach( key => {\n\n\t\t\t// css lookup for all nodes with the given view attribute\n\t\t\tvar nodes = root.all( '[view=' + key + ']' );\n\t\t\t\n\t\t\tnodes.forEach( node => {\n\n\t\t\t\t// do not scan if its already created\n\t\t\t\tif( node.native.view ) return;\n\n\t\t\t\t// create view from ioc\n\t\t\t\tvar view = this.ioc.get( key )( node, data );\n\n\t\t\t\t// store instance on native node\n\t\t\t\tif( view ) node.native.view = view;\n\t\t\t});\n\t\t});\n\t}\n\n\tfirst( name:string, root?:Node ) {\n\t\tif( root == undefined ) root = Node.fromNative( document.body );\n\t\tvar node = root.one( '[view=' + name + ']' );\n\t\treturn ( node && node.native.view ) ? node.native.view : null;\n\t}\n\n\t\n\tall( name:string, root?:Node ) {\n\n\t\tif( root == undefined ) root = Node.fromNative( document.body );\n\n\t\tvar views = [];\n\t\t\n\t\tvar nodes = root.all( '[view=' + name + ']' );\n\t\tnodes.forEach( node => {\n\t\t\tif( node.native.view ) views.push( node.native.view );\n\t\t});\n\t\t\n\t\treturn views;\n\t}\n}\n\nexport var scanner = new Scanner();\n\nexport default Scanner;\n","export var mapStyles = [\n {\n \"featureType\": \"all\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"color\": \"#7d8787\"\n }\n ]\n },\n {\n \"featureType\": \"all\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"color\": \"#7d8787\"\n }\n ]\n },\n {\n \"featureType\": \"all\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"all\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"all\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"color\": \"#7d8787\"\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n },\n {\n \"color\": \"#7d8787\"\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.man_made\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.man_made\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#e7e7e7\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.man_made\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#ffffff\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#f1f1f1\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi.attraction\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi.attraction\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi.business\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi.government\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi.medical\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"color\": \"#d3d689\"\n },\n {\n \"gamma\": 1.51\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#d3d689\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi.place_of_worship\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi.school\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi.sports_complex\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi.sports_complex\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#c7c7c7\"\n },\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n },\n {\n \"saturation\": \"-98\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#7d8787\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"color\": \"#bce3f1\"\n }\n ]\n }\n];","import Node from 'ln/node/Node';\nimport Template from 'ln/template/TemplateManager';\nimport View from 'ln/view/View';\nimport { scanner } from 'ln/view/Scanner';\nimport { mapStyles } from './MapStyles';\nimport OfferFilter from './OfferFilter';\nimport OfferDetail from './OfferDetail';\nimport setup from 'ln/setup/setup';\n\nexport interface IGoogleMapElement{\n\ttemplate:string,\n\toffers:any,\n\toffersFiltered:any\n}\n\nexport interface IOffer{\n\n\tcategory:string,\n\tlocation:{ lat:number, lng: number },\n\ttitle:string,\n\temail:string,\n\tphone:string,\n\twebsite:string\n}\n/**\n * This class renders a chapter element\n */\nclass GoogleMapElement extends View {\n\t\n\tprivate map;\n\tprivate pins:Array;\n\tprivate prefilter:string;\n\tprivate prezoom:string;\n\tprivate zoomLevel:number;\n\tpublic offersFiltered;\n\tpublic offerDetail;\n\n\tconstructor( private offers:IOffer[], prefilter:string, prezoom:string ) {\n\n\t\t\n\t\tsuper();\n\t\tthis.defaultTemplate = 'app.google-map';\n\t\tthis.prefilter = prefilter;\n\t\tthis.prezoom = prezoom;\n\t\tthis.zoomLevel = 8;\n\t\t\t\t\n\t\tthis.pins = [];\n\t\tthis.offersFiltered = [];\n\n\t}\n\n\tprivate MapTypeControl(controlDiv, map, mapType) {\n\n\t\t// Set CSS for the control border.\n\t\tvar controlUI = document.createElement('div');\n\t\tcontrolUI.classList.add('control-ui');\n\t\tcontrolUI.classList.add('-satellite');\n\t\tcontrolUI.title = 'Karten Typ anpassen auf \"' + mapType + '\"';\n\t\tcontrolDiv.appendChild(controlUI);\n\n\t\t// Setup the click event listeners: simply set the map to Chicago.\n\t\tcontrolUI.addEventListener('click', function() {\n\t\t\tmap.setMapTypeId(mapType);\n\t\t});\n\n\t}\n\n\tprivate ZoomControl(controlDiv, zoomType) {\n\n\t\t// Set CSS for the control border.\n\t\tvar controlUI = document.createElement('div');\n\t\tcontrolUI.classList.add('control-ui');\n\t\tcontrolUI.classList.add('-' + zoomType);\n\t\tcontrolUI.title = 'Zoom: \"' + zoomType + '\"';\n\t\tcontrolDiv.appendChild(controlUI);\n\n\t}\n\n\tonPinClick( pin ){\n\t\tif (pin.getAnimation() !== null) {\n\t\t\tpin.setAnimation(null);\n\t\t} else {\n\t\t\tpin.setAnimation(google.maps.Animation.BOUNCE);\n\t\t}\n\t}\n\n\tsetPins( ){\n\n\t\tthis.offers.forEach( offer => {\n\n\t\t\tvar pin = new google.maps.Marker({\n\t\t\t\tposition: offer.location, \n\t\t\t\tmap: this.map,\n\t\t\t\tcategory: offer.category,\n\t\t\t\t// offer: offer,\n\t\t\t\ttitle: offer.title + '\\n' + offer.email + '\\n' + offer.phone + '\\n' + offer.website,\n\t\t\t\ticon: {\n\t\t\t\t\t// url: window.location.href + \"/assets/pin-\" + offer.category + \".svg\",\n\t\t\t\t\turl: setup.route( 'svg', { file_name: 'pin-' + offer.category } ).url(),\n\t\t\t\t\tscaledSize: new google.maps.Size(50, 57),\n\t\t\t\t\tsize: new google.maps.Size(50, 57),\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tpin.addListener('click' , pinClicked.bind(this));\n\n\t\t\tthis.pins.push(pin);\n\n\t\t\tfunction pinClicked() {\n\t\t\t\tpin.setAnimation(google.maps.Animation.BOUNCE);\n\t\t\t\tsetTimeout(() => { pin.setAnimation(null); }, 1500); \n\t\t\t\tthis.offerDetail.setOffer( offer );\n\t\t\t}\n\n\t\t});\n\n\t}\n\n\tprivate filterPins( categories:string[] ){\n\n\t\tif( categories.length != 0 ){\n\t\t\t\n\t\t\tvar filtered = this.pins.filter( pin => {\n\t\t\t\treturn categories.indexOf( pin.category ) >= 0; \n\t\t\t\t//return categories.indexOf( pin.offer.category ) >= 0; \n\t\t\t});\n\t\n\t\t\t// remove all pins\n\t\t\tthis.pins.forEach( pin => {\n\t\t\t\tpin.setMap( null );\n\t\t\t})\n\t\n\t\t\t// set filtered pins\n\t\t\tfiltered.forEach( filteredPin => {\n\t\t\t\tfilteredPin.setMap( this.map );\n\t\t\t})\n\n\t\t} else {\n\t\t\tthis.pins.forEach( pin => {\n\t\t\t\tpin.setMap( this.map );\n\t\t\t})\n\t\t}\n\t}\n\n\t\n\t/**\n\t * Renders the chapter into its container.\n\t */\n\tpublic init() {\n\n\t\t// Älggi-Alp > initial map center\n\t\tvar swissGeoCenter = { lat: 46.798616, lng: 8.231963 };\n\n\t\tscanner.scan( this.node );\n\n\t\tvar offerfilter = scanner.first( 'offer-filter' ) as OfferFilter;\n\t\tofferfilter.selected.add( this.filterPins, this );\n\n\t\tthis.offerDetail = scanner.first( 'offer-detail' ) as OfferDetail;\n\n\t\t// if we got a prezoom via URL we set this one.\n\t\tif (this.prezoom !== null){\n\t\t\tthis.zoomLevel = parseInt(this.prezoom);\n\t\t}\n\n\n\t\t//this.map = new google.maps.Map(document.getElementById('google-map'), {\n\t\tthis.map = new google.maps.Map(this.node.js('google-map').native, {\n\t\t\tcenter: swissGeoCenter,\n\t\t\tzoom: this.zoomLevel,\n\t\t\tmapTypeId: 'roadmap', \n\t\t\tdisableDefaultUI: true,\n\t\t\tminZoom: 7,\n\t\t\tstyles: mapStyles\n\t\t});\n\n\n\t\t// Create new Control to change th Map-Type to: Roadmap\n\t\tvar mapTypeButton = document.createElement('div');\n\t\tmapTypeButton.classList.add('map-control', '-roadmap'); \n\t\tvar mapType = new this.MapTypeControl(mapTypeButton, this.map, \"roadmap\");\n\n\t\tmapTypeButton.index = 1;\n\t\tthis.map.controls[google.maps.ControlPosition.TOP_RIGHT].push(mapTypeButton);\n\n\t\tgoogle.maps.event.addDomListener(mapTypeButton, 'click', () => {\n\t\t\tif (mapTypeButton.classList.contains('-active')) {\n\t\t\t\tthis.map.setMapTypeId('roadmap'); \n\t\t\t\tmapTypeButton.classList.remove('-active');\n\t\t\t} else {\n\t\t\t\tthis.map.setMapTypeId('satellite'); \n\t\t\t\tmapTypeButton.classList.add('-active');\n\t\t\t}\n\t\t});\n\n\t\tthis.setPins();\n\n\t\t// Create new Control to Zoom out\n\t\tvar ZoomOutControlButton = document.createElement('div');\n\t\tZoomOutControlButton.classList.add('map-control', '-zoomout'); \n\t\tvar zoomOutControl = new this.ZoomControl(ZoomOutControlButton, \"out\");\n\n\t\tzoomOutControl.index = 3;\n\t\tthis.map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(ZoomOutControlButton);\n\n\t\tgoogle.maps.event.addDomListener(ZoomOutControlButton, 'click', () => {\n\t\t\tthis.map.setZoom(this.map.getZoom() - 1);\n\t\t});\n\n\t\t// Create new Control to Zoom in\n\t\tvar ZoomInControlButton = document.createElement('div');\n\t\tZoomInControlButton.classList.add('map-control', '-zoomin'); \n\t\tvar zoomInControl = new this.ZoomControl(ZoomInControlButton, \"in\");\n\n\t\tzoomInControl.index = 4;\n\t\tthis.map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(ZoomInControlButton);\n\n\t\t// add event listeners for the Zoom Buttons\n\t\tgoogle.maps.event.addDomListener(ZoomInControlButton, 'click', () => {\n\t\t\tthis.map.setZoom(this.map.getZoom() + 1);\n\t\t});\n\n\t\t// Places Search Input Field \n\t\tvar input = this.node.js('places-search').native;\n\t\tvar searchBox = new google.maps.places.SearchBox(input);\n\t\t// input.addEventListener( 'click', function(){\n\t\t// \tif(!input.classList.contains('-active')){\n\t\t// \t\tinput.classList.add('-active');\n\t\t// \t\tinput.classList.remove('-passive');\n\t\t// \t}\n\t\t// });\n\t\t// input.addEventListener( 'blur', function(){\n\t\t// \tif(input.classList.contains('-active')){\n\t\t// \t\tinput.classList.remove('-active');\n\t\t// \t\tinput.classList.add('-passive');\n\t\t// \t}\n\t\t// });\n\t\t//this.map.controls[google.maps.ControlPosition.BOTTOM_LEFT].push(input);\n\t\t\n\n\t\t// Bias the SearchBox results towards current map's viewport.\n\t\tthis.map.addListener('bounds_changed', () => {\n\t\t\tsearchBox.setBounds(this.map.getBounds());\n\t\t});\n\n\t\tvar markers = [];\n\t\t// Listen for the event fired when the user selects a prediction and retrieve\n\t\t// more details for that place.\n\t\tsearchBox.addListener('places_changed', () => {\n\t\t\tvar places = searchBox.getPlaces();\n\n\t\t\tif (places.length == 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Clear out the old markers.\n\t\t\tmarkers.forEach( marker => {\n\t\t\t\tmarker.setMap(null);\n\t\t\t});\n\t\t\tmarkers = [];\n\n\t\t\t// For each place, get the icon, name and location.\n\t\t\tvar bounds = new google.maps.LatLngBounds();\n\t\t\tplaces.forEach( place => {\n\t\t\t\tif (!place.geometry) {\n\t\t\t\t\tconsole.log(\"Returned place contains no geometry\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar icon = {\n\t\t\t\t\turl: place.icon,\n\t\t\t\t\tsize: new google.maps.Size(71, 71),\n\t\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\t\tanchor: new google.maps.Point(17, 34),\n\t\t\t\t\tscaledSize: new google.maps.Size(25, 25)\n\t\t\t\t};\n\n\t\t\t\t// Create a marker for each place.\n\t\t\t\tmarkers.push(new google.maps.Marker({\n\t\t\t\t\tmap: this.map,\n\t\t\t\t\ticon: icon,\n\t\t\t\t\ttitle: place.name,\n\t\t\t\t\tposition: place.geometry.location\n\t\t\t\t}));\n\n\t\t\t\tif (place.geometry.viewport) {\n\t\t\t\t\t// Only geocodes have viewport.\n\t\t\t\t\tbounds.union(place.geometry.viewport);\n\t\t\t\t} else {\n\t\t\t\t\tbounds.extend(place.geometry.location);\n\t\t\t\t}\n\n\t\t\t\tthis.map.fitBounds(bounds);\n\t\t\t});\n\t\t});\t\n\t\t\n\t\tif (this.prefilter !== null){\n\t\t\tthis.filterPins([ this.prefilter ]);\n\t\t\tdocument.querySelectorAll('[data-cat=\"' + this.prefilter + '\"]')[0].classList.add(\"-active\");\n\t\t}\n\t}\n\n}\n\nexport default GoogleMapElement;","import View from 'ln/view/View';\nimport Node from 'ln/node/Node';\nimport Template from 'ln/template/TemplateManager';\nimport { scanner } from 'ln/view/Scanner';\nimport Signal from 'ln/signal/Signal';\n\nclass OfferFilter extends View {\n\n public selected: Signal;\n\n constructor( ) {\n\n\t\tsuper( );\n this.defaultTemplate = 'app.offer-filter';\n\n this.selected = new Signal();\n \n }\n\n init() {\n\n this.node.js( 'filter-menu' ).click.add( () => {\n this.closeMenu();\n });\n this.node.js( 'close-menu' ).click.add( () => {\n this.closeMenu();\n });\n\n this.node.all( '.offer-element' ).forEach( offerElement => {\n offerElement.click.add( this.offerClicked, this );\n });\n\n this.node.js( 'filter-reset' ).click.add( () => {\n this.node.all( '.offer-element' ).forEach( offerElement => {\n offerElement.hasClass('-active') ? offerElement.removeClass('-active') : null;\n });\n this.selected.dispatch( [] );\n\n });\n \n }\n\n closeMenu(){\n var offersList = Node.fromNative(this.node.js( 'offers-container' ).native);\n var filterMenu = Node.js('filter-menu');\n filterMenu.toggleClass('-open');\n if (offersList.hasClass(\"-show\")) {\n offersList.removeClass(\"-show\");\n offersList.addClass(\"-hide\");\n } else {\n offersList.removeClass(\"-hide\");\n offersList.addClass(\"-show\");\n }\n }\n \n offerClicked( n:Node ){\n \n n.toggleClass( '-active' );\n\n var categories = [];\n // search all activated\n var activated = this.node.all( '.offer-element.-active' );\n \n activated.forEach( active => {\n categories.push( active.data.cat );\n });\n \n this.selected.dispatch( categories );\n\n }\n}\n\nexport default OfferFilter;\n\nscanner.ioc.add( 'offer-filter', function( n:Node ){\n return new OfferFilter().render( n );\n});\n\n\n","import View from 'ln/view/View';\nimport Node from 'ln/node/Node';\nimport Template from 'ln/template/TemplateManager';\nimport { scanner } from 'ln/view/Scanner';\n\nclass OfferDetail extends View {\n\n private offer;\n\n constructor( ) {\n\n super( );\n\n this.defaultTemplate = 'app.offer-detail';\n \n }\n\n // set offer\n public setOffer( offer ){\n \n this.offer = offer;\n var offerContainer = Node.fromHTML( Template.render( 'app.offer-container', this.offer));\n this.node.js('offer-container').replace(offerContainer);\n \n this.node.removeClass( '-hide' );\n this.node.addClass( '-show' );\n\n Node.all('.map-control').forEach( node => {\n node.addClass( '-moveleft' );\n node.removeClass( '-moveright' );\n });\n }\n\n public hide() {\n this.node.removeClass( '-show' );\n this.node.addClass( '-hide' );\n\n Node.all('.map-control').forEach( node => {\n node.removeClass( '-moveleft' );\n node.addClass( '-moveright' );\n });\n }\n\n init() {\n\n Node.js( 'close-button' ).mouseenter.add(() => {\n this.node.js(\"close-button\").addClass('-active');\n });\n\n Node.js( 'close-button' ).mouseleave.add(() => {\n this.node.js(\"close-button\").removeClass('-active');\n });\n\n Node.js( 'close-button' ).mousedown.add(() => {\n this.node.js(\"close-button\").addClass('-active');\n });\n\n Node.js( 'close-button' ).mouseup.add(() => {\n this.node.js(\"close-button\").removeClass('-active');\n });\n\n Node.js( 'close-button' ).click.add(() => {\n this.hide();\n });\n\n }\n\n}\n\nexport default OfferDetail;\n\nscanner.ioc.add( 'offer-detail', function( n:Node ){\n return new OfferDetail().render( n );\n});\n\n\n","import Node from 'ln/node/Node';\nimport Template from 'ln/template/TemplateManager';\nimport Lang from 'ln/lang/Lang';\n\nimport setup from 'ln/setup/setup';\nimport { SetupConfig } from 'ln/setup/setup';\n\nimport GoogleMapElement from './GoogleMapElement';\nimport './OfferFilter';\nimport './OfferDetail';\n\nimport './templates/template';\n// import './templates/icons';\n\n\nexport var offers;\n\nexport function init( config:SetupConfig ) {\n\t\n\tsetup.init( config );\n\n\tLang.add( config['lang'] );\n\n\n\tTemplate.context.setup = setup;\n\tTemplate.context.imagePath = function( image:{ file_name:string }, preset:string = 'medium', ext:string = 'png' ){\n\t\treturn decodeURIComponent( setup.route( 'asset', { file_name: image.file_name, preset:preset, ext:ext } ).url() );\n\t}\n\n\t\n\tvar map = new GoogleMapElement( setup.data( 'offers' ), config['filter'], config['zoom'] ).render( Node.one( '#google-map'));\n\n}","\nimport Template from 'ln/template/TemplateManager';\nTemplate.add( { app:{\"google-map\":\"
\",\"offer-filter\":\"
[[ this.trans( 'filter-offers') ]]
[[ this.trans( 'velo') ]]
[[ this.trans( 'events') ]]
[[ this.trans( 'poollift') ]]
[[ this.trans( 'eisgleiter') ]]
[[ this.trans( 'kayak') ]]
[[ this.trans( 'camping') ]]
[[ this.trans( 'dualski') ]]
[[ this.trans( 'fahrzeugmieten') ]]
[[ this.trans( 'wandern') ]]
[[ this.trans( 'reset-filters') ]]
[[ this.trans( 'go') ]]
\",\"offer-detail\":\"
\",\"offer-container\":\"
[% if( image ) { %][% } %]
[% if( title ) { %]

[[ title ]]

[% } %]

[[ this.trans( 'contact' ) ]]

[% if( address ) { %]
[[= address ]]
[% } %][% if( phone ) { %]
[[ phone ]]
[% } %][% if( email ) { %][% } %][% if( website ) { %][% } %]
\",\"maptype-control\":\"
Map
\"} } );\n"],"names":["module","exports","isFunction","x","isArray","Array","Object","prototype","toString","call","len","vertxNext","customSchedulerFn","asap","callback","arg","queue","flush","scheduleFlush","browserWindow","window","undefined","browserGlobal","BrowserMutationObserver","MutationObserver","WebKitMutationObserver","isNode","self","process","isWorker","Uint8ClampedArray","importScripts","MessageChannel","useSetTimeout","globalSetTimeout","setTimeout","i","channel","iterations","observer","node","then","onFulfillment","onRejection","parent","this","child","constructor","noop","PROMISE_ID","makePromise","_state","arguments","invokeCallback","_result","subscribe","resolve$1","object","promise","resolve","nextTick","document","createTextNode","observe","characterData","data","port1","onmessage","port2","postMessage","vertx","Function","require","runOnLoop","runOnContext","e","attemptVertx","Math","random","substring","PENDING","FULFILLED","REJECTED","handleMaybeThenable","maybeThenable","then$$1","thenable","fulfill","reject","value","reason","handleOwnThenable","sealed","error","fulfillmentHandler","rejectionHandler","tryThen","_label","handleForeignThenable","TypeError","type","publishRejection","_onerror","publish","_subscribers","length","subscribers","settled","detail","hasCallback","succeeded","id","Enumerator","Constructor","input","_instanceConstructor","_remaining","_enumerate","Error","_eachEntry","entry","c","resolve$$1","_then","didError","_settledAt","Promise$1","_willSettleAt","state","enumerator","Promise","resolver","needsResolver","initializePromise","needsNew","catch","finally","all","entries","race","_","_setScheduler","scheduleFn","_setAsap","asapFn","_asap","polyfill","local","g","P","promiseToString","cast","factory","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","d","definition","key","o","defineProperty","enumerable","get","globalThis","obj","prop","hasOwnProperty","r","Symbol","toStringTag","slots","add","listener","context","push","isOnce","addOnce","remove","filter","slot","removeAll","has","some","dispatch","forEach","apply","args","target","event","register","unregister","dispatchEvent","addEventListener","removeEventListener","native","setupSignals","fromHTML","html","tempDiv","Node","fromTag","children","tag","createElement","fromNative","innerHTML","style","checked","dataset","attrs","attributes","attr","name","substr","outerHTML","addClass","classname","setClasses","getClasses","concat","classlist","removeClass","filtered","indexOf","toggleClass","force","hasClass","className","SVGAnimatedString","baseVal","split","classnames","distinct","index","join","setAttribute","getAttribute","append","n","appendChild","prepend","firstChild","insertBefore","insert","childNodes","replace","replaceChild","toNodes","hasChildren","hasChild","removeChild","parentElement","empty","p","bounds","relative","getBoundingClientRect","top","left","right","bottom","height","width","body","scrollTop","documentElement","scrollLeft","css","property","currentStyle","defaultView","getComputedStyle","getPropertyValue","one","selector","htmlElement","querySelector","querySelectorAll","js","events","fragment","createRange","createContextualFragment","frag","createDocumentFragment","firstElementChild","collection","temp","Element","sources","source","fallback","result","s","lookup","search","current","keys","shift","checkOn","types","match","splice","inputType","slice","prefix","passes","esc","escape","url","encodeURIComponent","defaultPasses","render","template","compile","templateString","parse","contx","sanitize","pass","regex","mapper","text","unsanitize","revert","inner","singleton","cache","renderer","keyOrTemplate","translate","opts","def","condition","matchCondition","num","parts","found","parseConditions","trim","clearConditions","number","exec","from","to","bind","_method","_headers","progress","_url","request","XMLHttpRequest","onprogress","loaded","total","method","headers","load","sendRequest","parseJson","send","open","setRequestHeader","errorHandler","Request","statusText","onload","status","responseText","onerror","JSON","post","HttpRequest","put","delete","config","guessType","Asset","promises","loadScript","loadCSS","element","src","finalize","rel","href","head","pop","init","route","urlParams","asset","defaultTemplate","renderTemplate","renderData","map","closure","tmp","alias","newName","oldName","rename","scanner","ioc","scan","root","order","view","first","views","mapStyles","offers","prefilter","prezoom","zoomLevel","pins","offersFiltered","MapTypeControl","controlDiv","mapType","controlUI","classList","title","setMapTypeId","ZoomControl","zoomType","onPinClick","pin","getAnimation","setAnimation","google","maps","Animation","BOUNCE","setPins","offer","Marker","position","location","category","email","phone","website","icon","file_name","scaledSize","Size","size","addListener","offerDetail","setOffer","filterPins","categories","setMap","filteredPin","selected","parseInt","Map","center","lat","lng","zoom","mapTypeId","disableDefaultUI","minZoom","styles","mapTypeButton","controls","ControlPosition","TOP_RIGHT","addDomListener","contains","ZoomOutControlButton","RIGHT_BOTTOM","setZoom","getZoom","ZoomInControlButton","searchBox","places","SearchBox","setBounds","getBounds","markers","getPlaces","marker","LatLngBounds","place","geometry","origin","Point","anchor","viewport","union","extend","fitBounds","console","log","click","closeMenu","offerElement","offerClicked","offersList","active","cat","OfferFilter","offerContainer","hide","mouseenter","mouseleave","mousedown","mouseup","Lang","image","preset","ext","decodeURIComponent","OfferDetail","app"],"sourceRoot":""}