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AAKvB,KAAKmoB,G,ICpFvF,IAAIC,EAAsBhG,EAAoBiC,OAAE9N,EAAW,CAAC,IAAI,IAAI,WAAa,OAAO6L,EAAoB,MAAQ,IACpHgG,EAAsBhG,EAAoBiC,EAAE+D,E","sources":["webpack://mucklet-client/webpack/runtime/chunk loaded","webpack://mucklet-client/webpack/runtime/load script","webpack://mucklet-client/./src/common/modules/policies/PoliciesBody.js","webpack://mucklet-client/./src/common/modules/policies/Policies.js","webpack://mucklet-client/./src/common/modules/serviceWorker/ServiceWorker.js","webpack://mucklet-client/./src/client/modules/init-modules.js","webpack://mucklet-client/./src/client/app.js","webpack://mucklet-client/./src/common/components/ErrorScreenDialog.js","webpack://mucklet-client/./src/client/modules/init/clientBoot/ClientBoot.js","webpack://mucklet-client/./src/common/utils/escapeHtml.js","webpack://mucklet-client/./src/common/utils/formatDate.js","webpack://mucklet-client/./src/common/utils/reload.js","webpack://mucklet-client/./src/common/utils/sha256.js","webpack://mucklet-client/../../modapp/modapp-resource/src/Collection.js","webpack://mucklet-client/../../modapp/modapp-resource/src/CollectionWrapper.js","webpack://mucklet-client/../../modapp/modapp-resource/src/CollectionToModel.js","webpack://mucklet-client/../../modapp/modapp-resource/src/ModifyModel.js","webpack://mucklet-client/../../modapp/modapp-resource/src/ModelToCollection.js","webpack://mucklet-client/../../modapp/modapp-resource/src/ModelWrapper.js","webpack://mucklet-client/./node_modules/modapp-base-component/es/Context.js","webpack://mucklet-client/./node_modules/modapp-base-component/es/Html.js","webpack://mucklet-client/./node_modules/modapp-base-component/es/Input.js","webpack://mucklet-client/./node_modules/modapp-base-component/es/Textarea.js","webpack://mucklet-client/./node_modules/modapp-base-component/es/Transition.js","webpack://mucklet-client/./node_modules/modapp-utils/elem.js","webpack://mucklet-client/./src/client/modules/init|sync|C:/^/..*/([^/]*)/1.js$/i","webpack://mucklet-client/./node_modules/core-js/internals/array-for-each.js","webpack://mucklet-client/./node_modules/core-js/modules/es.array.map.js","webpack://mucklet-client/./node_modules/core-js/modules/es.string.iterator.js","webpack://mucklet-client/./node_modules/core-js/modules/web.dom-collections.for-each.js","webpack://mucklet-client/webpack/bootstrap","webpack://mucklet-client/webpack/runtime/compat get default export","webpack://mucklet-client/webpack/runtime/define property getters","webpack://mucklet-client/webpack/runtime/ensure chunk","webpack://mucklet-client/webpack/runtime/get javascript chunk filename","webpack://mucklet-client/webpack/runtime/get mini-css chunk filename","webpack://mucklet-client/webpack/runtime/global","webpack://mucklet-client/webpack/runtime/harmony module decorator","webpack://mucklet-client/webpack/runtime/hasOwnProperty shorthand","webpack://mucklet-client/webpack/runtime/make namespace object","webpack://mucklet-client/webpack/runtime/publicPath","webpack://mucklet-client/webpack/runtime/css loading","webpack://mucklet-client/webpack/runtime/jsonp chunk loading","webpack://mucklet-client/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"mucklet-client:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","import { Html } from 'modapp-base-component';\n\n/**\n * PoliciesBody renders the policies body.\n */\nclass PoliciesBody extends Html{\n\tconstructor(module, html) {\n\t\tsuper(html, { className: 'policies-body' });\n\t\tthis.module = module;\n\n\t\t// Set policy link bindings\n\t\tthis._policies = this.module.self.availablePolicies.map(p => ({\n\t\t\tslug: p,\n\t\t\tonClick: this._onClick.bind(this, p),\n\t\t\tlinks: null,\n\t\t}));\n\t}\n\n\trender(el) {\n\t\tlet rel = super.render(el);\n\n\t\tfor (let p of this._policies) {\n\t\t\tp.links = [];\n\t\t\tlet links = rel.getElementsByClassName(p.slug);\n\t\t\tfor (let l of links) {\n\t\t\t\tl.setAttribute('href', 'javascript:;');\n\t\t\t\tl.addEventListener('click', p.onClick);\n\t\t\t\tp.links.push(l);\n\t\t\t}\n\t\t}\n\t\treturn rel;\n\t}\n\n\tunrender() {\n\t\tfor (let p of this._policies) {\n\t\t\tif (p.links) {\n\t\t\t\tfor (let l of p.links) {\n\t\t\t\t\tl.removeEventListener('click', p.onClick);\n\t\t\t\t}\n\t\t\t\tp.links = null;\n\t\t\t}\n\t\t}\n\t\tsuper.unrender();\n\t}\n\n\t_onClick(policy, ev) {\n\t\tthis.module.self.openPolicy(policy);\n\t\tev.preventDefault();\n\t}\n}\n\nexport default PoliciesBody;\n","import { Elem, Txt } from 'modapp-base-component';\nimport l10n from 'modapp-l10n';\nimport ScreenDialog from 'components/ScreenDialog';\nimport escapeHtml from 'utils/escapeHtml';\nimport formatDate from 'utils/formatDate';\nimport PoliciesBody from './PoliciesBody';\nimport './policies.scss';\n\nconst availablePolicies = [\n\t'privacy',\n\t'terms',\n\t'payment',\n];\n\n/**\n * Policies draws the main login wireframe\n */\nclass Policies {\n\tconstructor(app, params) {\n\t\tthis.app = app;\n\n\t\tthis.app.require([ 'screen' ], this._init.bind(this));\n\t}\n\n\t_init(module) {\n\t\tthis.module = Object.assign({ self: this }, module);\n\t}\n\n\tget availablePolicies() {\n\t\treturn availablePolicies;\n\t}\n\n\topenPolicy(policy) {\n\t\tif (!availablePolicies.indexOf(policy) < 0) {\n\t\t\tconsole.error(\"Unknown policy:\", policy);\n\t\t\treturn;\n\t\t}\n\n\t\tlet url = escapeHtml('/policies/' + policy + '.json');\n\t\tfetch(url)\n\t\t\t.then(response => response.json())\n\t\t\t.then(data => {\n\t\t\t\tlet close = () => this.module.screen.removeSubcomponent(policy);\n\t\t\t\tthis.module.screen.addSubcomponent(policy, new ScreenDialog(\n\t\t\t\t\tnew Elem(n => n.elem('div', [\n\t\t\t\t\t\tn.component(data.created\n\t\t\t\t\t\t\t? new Txt(l10n.t('policies.lastUpdate', \"Last update {date}\", { date: formatDate(new Date(data.created), { showYear: true }) }), {\n\t\t\t\t\t\t\t\ttagName: 'span',\n\t\t\t\t\t\t\t\tclassName: 'policies--subtitle',\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t: null,\n\t\t\t\t \t\t),\n\t\t\t\t\t\tn.component(new PoliciesBody(this.module, data.body, { className: 'policies--body' })),\n\t\t\t\t\t\tn.elem('button', {\n\t\t\t\t\t\t\tevents: { click: close },\n\t\t\t\t\t\t\tclassName: 'policies--btn btn large primary',\n\t\t\t\t\t\t}, [\n\t\t\t\t\t\t\tn.component(new Txt(l10n.l('policies.close', \"Close\"))),\n\t\t\t\t\t\t]),\n\t\t\t\t\t])),\n\t\t\t\t\t{\n\t\t\t\t\t\tsize: 'wide',\n\t\t\t\t\t\ttitle: data.title,\n\t\t\t\t\t\tclose,\n\t\t\t\t\t},\n\t\t\t\t));\n\t\t\t});\n\t}\n\n\tdispose() {\n\t\tthis.model.off('change', this._onModelChange);\n\t\tthis._onUnsubscribe();\n\t}\n}\n\nexport default Policies;\n","import reload from 'utils/reload';\n\nconst serviceWorkerSupported = 'serviceWorker' in navigator;\nconst namespace = 'module.serviceWorker';\n\n/**\n * ServiceWorker register the service worker.\n */\nclass ServiceWorker {\n\tconstructor(app, params) {\n\t\tthis.app = app;\n\n\t\tthis.disableWorker = !!params.disableWorker;\n\n\t\t// Bind callbacks\n\t\tthis._onMessage = this._onMessage.bind(this);\n\n\t\tthis.app.require([], this._init.bind(this));\n\t}\n\n\t_init() {\n\t\tthis._tagOnClick = {};\n\t\tthis.promise = this.disableWorker\n\t\t\t? Promise.reject(\"worker disabled\")\n\t\t\t: new Promise((resolve, reject) => {\n\t\t\t\tthis._register(resolve, reject);\n\t\t\t});\n\t}\n\n\t/**\n\t * Attach an event handler function for one or more serviceworker message events.\n\t * @param {?string} events One or more space-separated events. Null means any event.\n\t * @param {Event~eventCallback} handler A function to execute when the event is emitted.\n\t */\n\ton(events, handler) {\n\t\tthis.app.eventBus.on(this, events, handler, namespace);\n\t}\n\n\t/**\n\t * Remove an event handler.\n\t * @param {?string} events One or more space-separated events. Null means any event.\n\t * @param {Event~eventCallback} [handler] An option handler function. The handler will only be remove if it is the same handler.\n\t */\n\toff(events, handler) {\n\t\tthis.app.eventBus.off(this, events, handler, namespace);\n\t}\n\n\t/**\n\t * Gets the promise of the registration.\n\t * @returns {Promise.} Service worker registration.\n\t */\n\tgetPromise() {\n\t\treturn this.promise;\n\t}\n\n\t/**\n\t * Clears the CacheStorage of all keys, and then performs a reload of the\n\t * client using no-cache headers.\n\t * @param {boolean} [updateServiceWorker] Flag to tell if the service-worker itself should be update. Defaults to false.\n\t */\n\tclearCacheAndReload(updateServiceWorker) {\n\t\tPromise.resolve(caches?.keys().then(keys => {\n\t\t\tfor (let key of keys) {\n\t\t\t\tcaches.delete(key);\n\t\t\t}\n\t\t})).then(() => {\n\t\t\tif (updateServiceWorker && this.registration) {\n\t\t\t\treturn this.registration.update();\n\t\t\t}\n\t\t}).then(() => {\n\t\t\treload(true);\n\t\t});\n\t}\n\n\t/**\n\t * Shows a notification. Notification permission must be obtained before calling.\n\t *\n\t * Normally you should use the module Notify and call notify.send(...)\n\t * @param {string|LocaleString} title Title of the notification.\n\t * @param {object} [opt] Optional parameters. Same as the Notification API with some additions.\n\t * @param {number} [opt.duration] Duration the notification will be open in milliseconds. Defaults to 5000.\n\t * @param {function} [opt.onClick] Callback called when notifications is clicked. Defaults to: n => { window.focus(); notification.close(); }\n\t * @param {number} [opt.data] Data to pass on to the onClick callback.\n\t * @param {boolean} [opt.alwaysNotify] Flag to always show notification even if window is in focus.\n\t */\n\tshowNotification(title, opt) {\n\t\treturn this.promise.then(registration => {\n\t\t\tif (registration) {\n\t\t\t\topt = Object.assign({}, opt);\n\t\t\t\tif (opt.onClick) {\n\t\t\t\t\tlet tag = opt.tag || (Math.random() + 1).toString(36).substring(2) + Date.now();\n\t\t\t\t\topt.tag = tag;\n\t\t\t\t\tthis._tagOnClick[tag] = opt.onClick;\n\t\t\t\t\tdelete opt.onClick;\n\t\t\t\t}\n\t\t\t\tregistration.active.postMessage({ method: 'showNotification', title, opt });\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Tries to close a notification with a specific tag.\n\t * @param {string} tag Tag.\n\t */\n\tcloseNotification(tag) {\n\t\tthis.promise.then(registration => {\n\t\t\tregistration?.active.postMessage({ method: 'closeNotification', tag });\n\t\t});\n\t}\n\n\t_onMessage(ev) {\n\t\tlet event = ev.data?.event;\n\t\tif (!event) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (event === 'notificationclick') {\n\t\t\tthis._handleNotificationclick(ev.data);\n\t\t}\n\t}\n\n\t_handleNotificationclick(ev) {\n\t\tlet { tag, data } = ev.params;\n\t\t// Check if we have tag onClick callback that comes from calling\n\t\t// showNotification direction, rather than getting the notification from\n\t\t// push.\n\t\tif (tag) {\n\t\t\tlet cb = this._tagOnClick[tag];\n\t\t\tif (cb) {\n\t\t\t\tdelete this._tagOnClick[tag];\n\t\t\t\tcb(data);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// If the data contains an 'event' in itself, emit it together with data.params.\n\t\tif (data?.event) {\n\t\t\tthis.app.eventBus.emit(this, namespace + '.' + data.event, data.params);\n\t\t}\n\t}\n\n\t_register(resolve, reject) {\n\t\tif (!serviceWorkerSupported) {\n\t\t\tconsole.log(\"[ServiceWorker] Not supported\");\n\t\t\treject(\"not supported\");\n\t\t\treturn;\n\t\t}\n\n\t\tnavigator.serviceWorker.addEventListener('message', this._onMessage);\n\t\tnavigator.serviceWorker.register('/service-worker.js').then(registration => {\n\t\t\tthis.registration = registration;\n\t\t\tconsole.log(\"[ServiceWorker] Registered: \", registration);\n\t\t\tresolve(registration);\n\t\t}).catch(registrationError => {\n\t\t\tconsole.log(\"[ServiceWorker] Registration failed: \", registrationError);\n\t\t\treject(registrationError);\n\t\t});\n\t}\n\n\t_unregister() {\n\t\tnavigator.serviceWorker.removeEventListener('message', this._onMessage);\n\t\tthis.registration?.unregister().then(success => {\n\t\t\tif (success) {\n\t\t\t\tconsole.log(\"[ServiceWorker] Unregistered\");\n\t\t\t\tthis.registration = null;\n\t\t\t} else {\n\t\t\t\tconsole.log(\"[ServiceWorker] Unregistration failed\");\n\t\t\t}\n\t\t});\n\t}\n\n\tdispose() {\n\t\tthis._unregister();\n\t}\n}\n\nexport default ServiceWorker;\n","import Api from 'modules/api/Api';\nimport Auth from 'modules/auth/Auth';\nimport Screen from 'modules/screen/Screen';\nimport Policies from 'modules/policies/Policies';\nimport ServiceWorker from 'modules/serviceWorker/ServiceWorker';\n\nconst modules = {\n\tapi: Api,\n\tauth: Auth,\n\tscreen: Screen,\n\tpolicies: Policies,\n\tserviceWorker: ServiceWorker,\n};\n\nconst req = require.context(\"./init/\", true, /^\\..*\\/([^/]*)\\/\\1.js$/i);\n\n// Using the first-character-lowercase name of the js-file as module name\nreq.keys().forEach(key => {\n\tlet match = key.match(/\\/([^/]*)\\.js$/);\n\tlet name = match[1].charAt(0).toLowerCase() + match[1].slice(1);\n\tif (modules[name]) {\n\t\tthrow new Error(`Duplicate module: ${key}`);\n\t}\n\tmodules[name] = req(key).default;\n});\n\nexport default modules;\n","import { AppExt } from 'modapp';\nimport initModules from 'modules/init-modules';\nimport moduleConfig from 'moduleConfig';\nimport 'scss/index.scss';\n\n// Create app and load core modules\nlet app = new AppExt(moduleConfig, { props: window.appProps });\napp.loadBundle(initModules).then(result => {\n\tconsole.log(\"Init modules: \", result);\n\tapp.render(document.body);\n});\n\n// Make app global\nwindow.app = app;\n","import { Elem, Txt } from 'modapp-base-component';\nimport l10n from 'modapp-l10n';\nimport ConfirmScreenDialog from './ConfirmScreenDialog';\nimport { redirect } from 'utils/reload';\nimport './errorScreenDialog.scss';\n\n/**\n * Draws an error screen dialog with a button that redirects to a given URL.\n */\nclass ErrorScreenDialog {\n\n\t/**\n\t * Creates a new ErrorScreenDialog instance.\n\t * @param {object} err Error object\n\t * @param {object} [opt] Optional parameters.\n\t * @param {string} [opt.redirectUrl] Redirect URL for the back button. Defaults to the same page without queries.\n\t * @param {LocaleString} [opt.titleTxt] Dialog title. Defaults to \"Something went wrong\".\n\t * @param {LocaleString} [opt.infoTxt] Dialog into text. Defaults to \"We got this error message:\".\n\t * @param {LocaleString} [opt.buttonTxt] Button text. Defaults to \"Go back\".\n\t * @param {function} [opt.onClose] Callback to call on close, instead of redirect.\n\t */\n\tconstructor(err, opt) {\n\t\tthis.err = err;\n\t\tthis.opt = opt || {};\n\t}\n\n\trender(el) {\n\t\tlet opt = this.opt;\n\t\tlet cb = () => this.opt.onClose ? this.opt.onClose() : this._redirect();\n\t\tthis.elem = new ConfirmScreenDialog({\n\t\t\ttitle: opt.titleTxt || l10n.l('errorScreenDialog.title', \"Something went wrong\"),\n\t\t\tconfirm: opt.buttonTxt || l10n.l('errorScreenDialog.goback', \"Go back\"),\n\t\t\tbody: new Elem(n => n.elem('div', { className: 'errorscreendialog' }, [\n\t\t\t\tn.component(new Txt(opt.infoTxt || l10n.l('errorScreenDialog.errorOccured', \"We got this error message:\"), { tagName: 'p' })),\n\t\t\t\tn.component(this.err\n\t\t\t\t\t? new Txt(l10n.l(this.err.code, this.err.message, this.err.data), { tagName: 'p', className: 'errorscreendialog--message' })\n\t\t\t\t\t: null,\n\t\t\t\t),\n\t\t\t])),\n\t\t\tonConfirm: cb,\n\t\t\tonClose: cb,\n\t\t});\n\t\tthis.elem.render(el);\n\t}\n\n\tunrender() {\n\t\tif (this.elem) {\n\t\t\tthis.elem.unrender();\n\t\t\tthis.elem = null;\n\t\t}\n\t}\n\n\t_redirect() {\n\t\tredirect(this.opt.redirectUrl || window.location.href.split('?')[0]);\n\t}\n}\n\nexport default ErrorScreenDialog;\n","// import { Elem, Txt } from 'modapp-base-component';\nimport { uri } from 'modapp-utils';\nimport { Model } from 'modapp-resource';\nimport l10n from 'modapp-l10n';\nimport ErrorScreenDialog from 'components/ErrorScreenDialog';\nimport ConfirmScreenDialog from 'components/ConfirmScreenDialog';\nimport Err from 'classes/Err';\n\nconst txtErrorAuthenticating = l10n.l('clientBoot.errorAuthenticating', \"An error occurred when trying to authenticate:\");\nconst txtTryAgain = l10n.l('clientBoot.tryAgain', \"Try again\");\n\n/**\n * ClientBoot boots the app by trying to authenticate, and then showing the\n * appropriate screen depending on success.\n */\nclass ClientBoot {\n\n\tconstructor(app, params) {\n\t\tthis.app = app;\n\n\t\tthis.app.require([\n\t\t\t'auth',\n\t\t\t'screen',\n\t\t], this._init.bind(this));\n\t}\n\n\t_init(module) {\n\t\tthis.module = Object.assign({ self: this }, module);\n\t\tthis.model = new Model({ data: { connected: false, authenticated: false, error: false }, eventBus: this.app.eventBus });\n\n\t\t// Load module bundles\n\t\tthis.mainModulesPromise = import(/* webpackChunkName: \"main\" */ 'modules/main-modules');\n\t\tthis.greetingModulesPromise = import(/* webpackChunkName: \"greeting\" */ 'modules/greeting-modules');\n\n\t\tthis._tryAuthenticate();\n\t}\n\n\t_tryAuthenticate() {\n\t\tlet q = uri.getQuery();\n\t\tif (q.error) {\n\t\t\tlet err;\n\t\t\ttry {\n\t\t\t\terr = JSON.parse(atob(q.error));\n\t\t\t} catch (e) {\n\t\t\t\terr = new Err('clientBoot.failedToParse', \"Failed to parse error: {message}\", { message: e.message });\n\t\t\t}\n\t\t\tthis._showError(null, err);\n\t\t} else {\n\t\t\tthis.module.auth.authenticate(true)\n\t\t\t\t.then(user => {\n\t\t\t\t\tthis.model.set({ connected: true, authenticated: !!user });\n\t\t\t\t\tif (user) {\n\t\t\t\t\t\tthis.mainModulesPromise.then(({ default: mainModules }) => {\n\t\t\t\t\t\t\tapp.loadBundle(mainModules).then(result => {\n\t\t\t\t\t\t\t\tconsole.log(\"[ClientBoot] Main modules: \", result);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.greetingModulesPromise.then(({ default: greetingModules }) => {\n\t\t\t\t\t\t\tapp.loadBundle(greetingModules).then(result => {\n\t\t\t\t\t\t\t\tconsole.log(\"[ClientBoot] Greeting modules: \", result);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tthis.model.set({ error: true });\n\t\t\t\t\tif (err.code == 'system.connectionError') {\n\t\t\t\t\t\terr = new Err(err.code, \"Failed to connect to the realm.\");\n\t\t\t\t\t}\n\t\t\t\t\tthis._showError(txtErrorAuthenticating, err);\n\t\t\t\t});\n\t\t}\n\t}\n\n\t_showError(infoTxt, err) {\n\t\t// Offline overrides any other error\n\t\tif (!navigator.onLine) {\n\t\t\treturn this._showOffline();\n\t\t}\n\n\t\tthis.module.screen.setComponent(new ErrorScreenDialog(err, {\n\t\t\tinfoTxt,\n\t\t\tbuttonTxt: txtTryAgain,\n\t\t\tonClose: () => {\n\t\t\t\tthis.module.screen.setComponent(null);\n\t\t\t\tthis._tryAuthenticate();\n\t\t\t},\n\t\t}));\n\t}\n\n\t_showOffline() {\n\t\tlet cb = () => {\n\t\t\twindow.addEventListener('online', cb);\n\t\t\tthis.module.screen.setComponent(null);\n\t\t\tthis._tryAuthenticate();\n\t\t};\n\t\twindow.addEventListener('online', cb);\n\t\tthis.module.screen.setComponent(new ConfirmScreenDialog({\n\t\t\ttitle: l10n.l('clientBoot.noInternet', \"No Internet\"),\n\t\t\tconfirm: txtTryAgain,\n\t\t\tbody: l10n.l('clientBoot.errorOffline1', \"You seem to have no Internet connection, and we kind of need one.\"),\n\t\t\tonConfirm: cb,\n\t\t}));\n\t}\n}\n\nexport default ClientBoot;\n","const escapeMap = {\n\t'&': '&',\n\t'<': '<',\n\t'>': '>',\n\t'\"': '"',\n\t\"'\": ''',\n};\n\nconst repl = function(c) {\n\treturn escapeMap[c];\n};\n\n/**\n * Escapes HTML special char on a string, eg. turning into <i>\n * @param {string} str String to escape.\n * @returns {string} String with special chars escaped.\n */\nexport default function escapeHtml(str) {\n\tif (!str) return '';\n\treturn str.replace(/[&<>'\"]/g, repl);\n}\n","const months = [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ];\n\n/**\n * Formats a Date object to a string in human readable format.\n * @param {Date} date Date object.\n * @param {object} [opt] Optional parameters.\n * @param {boolean} [opt.showYear] Flag to always show year.\n * @returns {string} Formatted string.\n */\nexport default function formatDate(date, opt) {\n\topt = opt || {};\n\tlet n = new Date();\n\t// Add year if older than a year\n\treturn date.getDate() + \" \" + months[date.getMonth()] + (opt.showYear || date < new Date(n.getFullYear() - 1, n.getMonth(), n.getDate()) ? \" \" + date.getFullYear() : \"\");\n}\n","let cbs = [];\nlet forced = false;\n\nfunction locationReload(clearQuery, force) {\n\tforced = true;\n\tsetTimeout(() => forced = false, 100);\n\n\tlet href = window.location.href;\n\tlet url = clearQuery ? href.split('?')[0] : href;\n\tif (url == href) {\n\t\twindow.location.reload();\n\t} else {\n\t\twindow.location.replace(url);\n\t}\n}\n\nexport function addBeforeUnload(f) {\n\tlet cb = e => {\n\t\tif (forced) return;\n\t\treturn f(e);\n\t};\n\twindow.addEventListener('beforeunload', cb);\n\tcbs.push({ cb, f });\n}\n\nexport function removeBeforeUnload(f) {\n\tcbs = cbs.filter(o => {\n\t\tlet found = o.f == f;\n\t\tif (found) {\n\t\t\twindow.addEventListener('beforeunload', o.cb);\n\t\t}\n\t\treturn !found;\n\t});\n}\n\n/**\n * Reloads the client.\n * @param {boolean} [clearCache] Flag if the cache should be cleared. Defaults to false.\n * @param {boolean} [clearQuery] Flag if the query should be cleared. Defaults to false.\n */\nexport default function reload(clearCache, clearQuery) {\n\tif (clearCache) {\n\t\t// Try to evict old version from cache\n\t\tfetch(window.location.href, {\n\t\t\theaders: {\n\t\t\t\t\"Pragma\": \"no-cache\",\n\t\t\t\t\"Expires\": -1,\n\t\t\t\t\"Cache-Control\": \"no-cache\",\n\t\t\t},\n\t\t}).then(() => locationReload(clearQuery));\n\t} else {\n\t\tlocationReload(clearQuery);\n\t}\n};\n\nexport function redirect(url, includeQuery, pushHistory) {\n\tforced = true;\n\tsetTimeout(() => forced = false, 100);\n\n\tlet href = window.location.href;\n\tif (includeQuery) {\n\t\tlet idx = href.indexOf('?');\n\t\tif (idx >= 0) {\n\t\t\turl = url + (url.indexOf('?') >= 0 ? '&' : '?') + href.slice(idx + 1).split('#')[0];\n\t\t}\n\t}\n\tif (url == href) {\n\t\twindow.location.reload();\n\t} else if (pushHistory) {\n\t\twindow.location.assign(url);\n\t} else {\n\t\twindow.location.replace(url);\n\t}\n};\n","/* eslint-disable */\nvar chrsz = 8;\n\nfunction safe_add (x, y) {\n\tvar lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\tvar msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\treturn (msw << 16) | (lsw & 0xFFFF);\n}\n\nfunction S (X, n) { return ( X >>> n ) | (X << (32 - n)); }\nfunction R (X, n) { return ( X >>> n ); }\nfunction Ch(x, y, z) { return ((x & y) ^ ((~x) & z)); }\nfunction Maj(x, y, z) { return ((x & y) ^ (x & z) ^ (y & z)); }\nfunction Sigma0256(x) { return (S(x, 2) ^ S(x, 13) ^ S(x, 22)); }\nfunction Sigma1256(x) { return (S(x, 6) ^ S(x, 11) ^ S(x, 25)); }\nfunction Gamma0256(x) { return (S(x, 7) ^ S(x, 18) ^ R(x, 3)); }\nfunction Gamma1256(x) { return (S(x, 17) ^ S(x, 19) ^ R(x, 10)); }\n\n/**\n * Creates a SHA256 hash.\n * @param {Array} m Binary array\n * @param {number} l Array length in bits.\n * @returns\n */\nfunction core_sha256 (m, l) {\n\tvar K = new Array(0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, 0xE49B69C1, 0xEFBE4786, 0xFC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x6CA6351, 0x14292967, 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2);\n\tvar HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19);\n\tvar W = new Array(64);\n\tvar a, b, c, d, e, f, g, h, i, j;\n\tvar T1, T2;\n\n\tm[l >> 5] |= 0x80 << (24 - l % 32);\n\tm[((l + 64 >> 9) << 4) + 15] = l;\n\n\tfor ( var i = 0; i>5] |= (str.charCodeAt(i / 8) & 255) << (24 - i%32);\n\t}\n\treturn bin;\n}\n\nfunction Utf8Encode(string) {\n\tstring = string.replace(/\\r\\n/g,\"\\n\");\n\tvar utftext = \"\";\n\n\tfor (var n = 0; n < string.length; n++) {\n\n\t\tvar c = string.charCodeAt(n);\n\n\t\tif (c < 128) {\n\t\t\tutftext += String.fromCharCode(c);\n\t\t}\n\t\telse if((c > 127) && (c < 2048)) {\n\t\t\tutftext += String.fromCharCode((c >> 6) | 192);\n\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t}\n\t\telse {\n\t\t\tutftext += String.fromCharCode((c >> 12) | 224);\n\t\t\tutftext += String.fromCharCode(((c >> 6) & 63) | 128);\n\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t}\n\n\t}\n\n\treturn utftext;\n}\n\nfunction binb2base64(binarray) {\n\tvar bytes = new Uint8Array(binarray.length * 4);\n\tfor(var i = 0; i < binarray.length * 4; i++) {\n\t\tbytes[i] = (binarray[i>>2] >> ((3 - i%4)*8)) & 0xFF;\n\t}\n\tlet s = String.fromCharCode.apply(null, bytes);\n\treturn typeof btoa == 'function'\n\t\t? btoa(s)\n\t\t: Buffer.from(s, 'binary').toString('base64');\n}\n\n/**\n * Turns the key into a block sized key by hashing longer keys, or zero padding\n * shorter.\n * @param {Array} key Binary array key to turn block sized.\n * @param {number} len Length of key in bytes.\n * @param {function} hash Hash function.\n * @param {number} blockSize Block size of the hash in bytes.\n * @returns {Array} Blocksized binary array key.\n */\nfunction computeBlockSizedKey(key, len, hash, blockSize, xor) {\n\tif (len > blockSize) {\n\t\tkey = hash(key, len * chrsz);\n\t} else {\n\t\tkey = append(new Array(), 0, key, len);\n\t}\n\tfor(var i = 0; i < blockSize * chrsz; i += chrsz) {\n\t\tkey[i>>5] ^= xor << (24 - i%32);\n\t}\n\treturn key;\n}\n\nfunction append(a, alen, b, blen) {\n\tfor(var i = 0; i < blen; i++) {\n\t\ta[(i + alen)>>2] |= ((b[i>>2] >> (8 * (3 - i%4))) & 255) << (8 * (3 - (i + alen)%4));\n\t}\n\treturn a;\n}\n\n/**\n * Encodes a string into a sha256 encoded base64 encoded string.\n * @param {string} s String to encode\n * @returns {string} Sha256 and base64 encoded string.\n */\nexport default function sha256(s) {\n\ts = Utf8Encode(s);\n\treturn binb2base64(core_sha256(str2binb(s), s.length * chrsz));\n}\n\n/**\n * Encodes a string and a key into a hmacsha256 encoded base64 encoded string.\n * @param {*} s String to encode\n * @param {*} key Key to use with encoding\n * @returns {string} Base64 encoded string\n */\nexport function hmacsha256(s, key) {\n\ts = Utf8Encode(s);\n\n\tkey = Utf8Encode(key);\n\tlet bkey = str2binb(key);\n\tlet outer_key = computeBlockSizedKey(bkey, key.length, core_sha256, 64, 0x5c);\n\tlet inner_key = computeBlockSizedKey(bkey, key.length, core_sha256, 64, 0x36);\n\n\tlet inner = core_sha256(append(inner_key, 64, str2binb(s), s.length), 8 * (64 + s.length));\n\treturn binb2base64(core_sha256(append(outer_key, 64, inner, inner.length * 4), 8 * (64 + inner.length * 4)));\n}\n\n/**\n * Public pepper to use as HMAC key when pre-hashing the password.\n */\nexport const publicPepper = 'TheStoryStartsHere';\n","import SortedMap from './SortedMap';\nimport eventBus from 'modapp-eventbus';\nimport { obj } from 'modapp-utils';\n\n/**\n * Collection is a generic data collection.\n * @implements {module:modapp~Collection}\n */\nclass Collection {\n\n\t/**\n\t * Creates a Collection instance\n\t * @param {object} [opt] Optional settings.\n\t * @param {Array.} [opt.data] Collection data array.\n\t * @param {function} [opt.compare] Compare function for sort order. Defaults to insert order.\n\t * @param {function} [opt.modelFactory] Model factory function. Defaults to using added objects as is.\n\t * @param {function} [opt.idAttribute] Id attribute callback function. Defaults to returning the object.id property.\n\t * @param {string} [opt.namespace] Event bus namespace. Defaults to 'collection'.\n\t * @param {module:modapp~EventBus} [opt.eventBus] Event bus.\n\t */\n\tconstructor(opt) {\n\t\topt = obj.copy(opt, {\n\t\t\tcompare: { type: '?function' },\n\t\t\tmodelFactory: { type: '?function' },\n\t\t\tidAttribute: { type: '?function', default: m => m.id },\n\t\t\tdata: { type: '?object' },\n\t\t\tnamespace: { type: 'string', default: 'collection' },\n\t\t\teventBus: { type: 'object', default: eventBus }\n\t\t});\n\n\t\tthis._modelFactory = opt.modelFactory;\n\t\tthis._idAttribute = opt.idAttribute;\n\t\tthis._namespace = opt.namespace;\n\t\tthis._eventBus = opt.eventBus;\n\n\t\tthis._map = opt.idAttribute ? new SortedMap(opt.compare) : [];\n\n\t\t// Populate map with initial data\n\t\tif (opt.data) {\n\t\t\tfor (let item of opt.data) {\n\t\t\t\tthis._addItem(item, false);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Attach an event handler function for one or more instance events.\n\t * Available events are 'add', 'remove', and 'move'.\n\t * @param {?string} events One or more space-separated events. Null means any event.\n\t * @param {EventBus~eventCallback} [handler] A function to execute when the event is emitted.\n\t * @returns {this}\n\t */\n\ton(events, handler) {\n\t\tthis._eventBus.on(this, events, handler, this._namespace);\n\t\treturn this;\n\t}\n\n\t /**\n\t * Remove an instance event handler.\n\t * Available events are 'add', 'remove', and 'move'.\n\t * @param {?string} events One or more space-separated events. Null means any event.\n\t * @param {EventBus~eventCallback} [handler] An option handler function. The handler will only be remove if it is the same handler.\n\t * @returns {this}\n\t */\n\toff(events, handler) {\n\t\tthis._eventBus.off(this, events, handler, this._namespace);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Add an item to the collection.\n\t * @param {*} item Item to add\n\t * @param {idx} [idx] Index value of where to insert the item. Ignored if the collection has a compare function.\n\t * @returns {number} Index value of where the item was inserted in the list\n\t */\n\tadd(item, idx) {\n\t\treturn this._addItem(item, true, idx);\n\t}\n\n\t/**\n\t * Remove an item from the collection.\n\t * @param {string} id Id of the item.\n\t * @returns {number} Order index of the item before removal. -1 if the item id doesn't exist\n\t */\n\tremove(id) {\n\t\tif (!this._idAttribute) {\n\t\t\tthrow new Error(\"No id attribute set.\");\n\t\t}\n\t\tlet item = this.get(id);\n\t\tif (!item) return -1;\n\n\t\tlet idx = this._map.remove(id);\n\n\t\t// Emit event if an item was removed\n\t\tif (idx >= 0) {\n\t\t\tthis._eventBus.emit(this, this._namespace + '.remove', { item: item, idx: idx });\n\t\t}\n\n\t\treturn idx;\n\t}\n\n\t/**\n\t * Remove an item at a given index.\n\t * @param {*} idx Index value of the item to remove.\n\t * @returns {*} Removed item.\n\t */\n\tremoveAtIndex(idx) {\n\t\tif (idx < 0 || idx >= this._map.length) {\n\t\t\tthrow new Error(\"Index out of bounds.\");\n\t\t}\n\n\t\tlet item = this._map[idx];\n\t\tif (this._idAttribute) {\n\t\t\tthis._map.remove(this._idAttribute(item));\n\t\t} else {\n\t\t\tthis._map.splice(idx, 1);\n\t\t}\n\n\t\tthis._eventBus.emit(this, this._namespace + '.remove', { item: item, idx: idx });\n\n\t\treturn item;\n\t}\n\n\t/**\n\t * Get an item from the collection by id\n\t * @param {string} id Id of the item\n\t * @returns {*} Stored item. Undefined if key doesn't exist\n\t */\n\tget(id) {\n\t\tif (!this._idAttribute) {\n\t\t\tthrow new Error(\"No id attribute set.\");\n\t\t}\n\t\treturn this._map.get(id);\n\t}\n\n\t/**\n\t * Move an item within the collection.\n\t * Invalid if the collection has a compare function.\n\t * @param {string} id Id of the item\n\t * @param {*} idx Index to move the item to\n\t * returns {number} Order index of the item before moving. -1 if the item id doesn't exist.\n\t */\n\tmove(id, idx) {\n\t\tif (this.compare) throw \"Cannot use move in list with compare\";\n\n\t\tthrow \"Not implemented\";\n\t}\n\n\t/**\n\t * Retrieves the order index of an item.\n\t * @param {string|object} item Item or id of the item\n\t * @returns {number} Order index of the item. -1 if the item id doesn't exist.\n\t */\n\tindexOf(item) {\n\t\tif (typeof item === 'string') {\n\t\t\titem = this._map.get(item);\n\t\t\tif (!item) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t\treturn this._map.indexOf(item);\n\t}\n\n\tatIndex(idx) {\n\t\treturn this._map[idx];\n\t}\n\n\tget length() {\n\t\treturn this._map.length;\n\t}\n\n\ttoArray() {\n\t\treturn this._map.slice();\n\t}\n\n\t_addItem(item, emit, idx) {\n\t\tif (this._modelFactory) {\n\t\t\titem = this._modelFactory(item);\n\t\t}\n\n\t\tif (this._idAttribute) {\n\t\t\tidx = this._map.add(this._idAttribute(item), item, idx);\n\t\t} else {\n\t\t\tif (typeof idx != 'number') {\n\t\t\t\tidx = this._map.length;\n\t\t\t} else if (idx < 0 || idx > this._map.length) {\n\t\t\t\tthrow new Error(\"Index out of bounds.\");\n\t\t\t}\n\t\t\tthis._map.splice(idx, 0, item);\n\t\t}\n\t\tif (emit) {\n\t\t\tthis._eventBus.emit(this, this._namespace + '.add', { item: item, idx: idx });\n\t\t}\n\t\treturn idx;\n\t}\n\n\t[Symbol.iterator]() {\n\t\tlet i = 0,\n\t\t\ta = this._map,\n\t\t\tl = a.length;\n\n\t\treturn {\n\t\t\tnext: function() {\n\t\t\t\treturn { value: a[i++], done: i > l };\n\t\t\t}\n\t\t};\n\t}\n}\n\nexport default Collection;\n\nexport function sortOrderCompare(a, b) {\n\treturn a.sortOrder - b.sortOrder;\n};\n","import eventBus from 'modapp-eventbus';\nimport { array, obj } from 'modapp-utils';\nimport { toArray, patchDiff } from './utils';\n\n/**\n * A wrapper for a {@link module:modapp~Collection}, exposing the underlaying\n * data but can provide a different sort order, mapping of items, filtering of\n * items, or slicing of the collection. It will transparently propagate emitted\n * add and remove events.\n * @implements {module:modapp~Collection}\n */\nclass CollectionWrapper {\n\n\t/**\n\t * Creates an CollectionWrapper instance.\n\t * @param {object} collection Collection object to wrap.\n\t * @param {object} [opt] Optional parameters.\n\t * @param {function} [opt.map] Model map callback. If not provided, item objects will be stored as is.\n\t * @param {function} [opt.filter] Model filter callback. Parameter is a item of the underlying collection.\n\t * @param {number} [opt.begin] Zero-based index at which to begin extraction, similar to Array.slice.\n\t * @param {?number} [opt.end] Zero-based index before which to end extraction, similar to Array.slice. Null extracts until the end of the collection.\n\t * @param {function} [opt.compare] Sort compare function.\n\t * @param {string} [opt.namespace] Event bus namespace. Defaults to 'collectionWrapper'.\n\t * @param {module:modapp~EventBus} [opt.eventBus] Event bus.\n\t * @param {?number} [opt.autoDispose] Milliseconds until dispose is called after the number of listeners reaches zero. Default is never.\n\t */\n\tconstructor(collection, opt = {}) {\n\t\tthis._collection = collection || null;\n\n\t\tobj.update(this, opt, {\n\t\t\tmap: { type: '?function', property: '_map' },\n\t\t\tfilter: { type: '?function', property: '_filter' },\n\t\t\tbegin: { type: 'number', default: 0, property: '_begin' },\n\t\t\tend: { type: '?number', property: '_end' },\n\t\t\tcompare: { type: '?function', property: '_compare' },\n\t\t\tnamespace: { type: 'string', default: 'collectionWrapper', property: '_namespace' },\n\t\t\teventBus: { type: 'object', default: eventBus, property: '_eventBus' },\n\t\t\tautoDispose: { type: '?number', property: '_autoDispose' }\n\t\t});\n\n\t\tif (this._map) {\n\t\t\tthis._weakMap = new WeakMap();\n\t\t}\n\n\t\t// Bind callbacks\n\t\tthis._onAdd = this._onAdd.bind(this);\n\t\tthis._onRemove = this._onRemove.bind(this);\n\t\tthis._listen = !!(this._filter || this._map || this._compare);\n\t\tif (this._listen) {\n\t\t\tthis._onChange = this._onChange.bind(this);\n\t\t}\n\n\t\tthis._onCount = 0;\n\t\tthis._timeout = null;\n\t\tthis._disposed = false;\n\n\t\tthis._initList();\n\t\tthis._setEventListeners(true);\n\t\tthis._checkAutoDispose(0);\n\t}\n\n\t_initList() {\n\t\tthis._list = [];\n\t\tthis._len = 0;\n\n\t\tif (!this._collection) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet getModel = this._map\n\t\t\t? item => {\n\t\t\t\tlet m = this._map(item, this._collection);\n\t\t\t\tthis._weakMap.set(item, m);\n\t\t\t\treturn m;\n\t\t\t}\n\t\t\t: item => item;\n\t\tlet add = this._filter\n\t\t\t? (item, m) => {\n\t\t\t\tlet c = this._wrapModel(m, item);\n\t\t\t\tif (c.f) this._len++;\n\t\t\t\tthis._list.push(c);\n\t\t\t}\n\t\t\t: (item, m) => {\n\t\t\t\tthis._list.push(this._wrapModel(m, item));\n\t\t\t\tthis._len++;\n\t\t\t};\n\n\t\tfor (let item of this._collection) {\n\t\t\tlet m = getModel(item);\n\t\t\tif (this._listen && item.on) {\n\t\t\t\titem.on('change', this._onChange);\n\t\t\t}\n\t\t\tadd(item, m);\n\t\t}\n\n\t\tif (this._compare) {\n\t\t\tthis._list.sort((a, b) => this._compare(a.m, b.m));\n\t\t}\n\t}\n\n\t/**\n\t * Length of the collection.\n\t */\n\tget length() {\n\t\tlet s = this._beginIdx();\n\t\tlet e = this._endIdx();\n\t\treturn s > e ? 0 : e - s;\n\t}\n\n\t/**\n\t * Returns the wrapped collection.\n\t * @returns {object}\n\t */\n\tgetCollection() {\n\t\treturn this._collection;\n\t}\n\n\ttoJSON() {\n\t\treturn this._array().map(m => m.toJSON ? m.toJSON() : m);\n\t}\n\n\t/**\n\t * Returns an array of the collection items.\n\t * @returns {Array.<*>} An array of items.\n\t */\n\ttoArray() {\n\t\treturn this._array();\n\t}\n\n\t/**\n\t * Creates an array filled with all array elements that pass a test.\n\t *\n\t * Short hand for CollectionWrapper.toArray().filter(filter).\n\t * @param {function} filter Filter predicate function.\n\t * @returns {Array} A new array with the elements that pass the test.\n\t */\n\tfilter(filter) {\n\t\treturn this._array().filter(filter);\n\t}\n\n\t/**\n\t * Creates a new array populated with the results of calling a provided\n\t * function on every element in the calling array.\n\t *\n\t * Short hand for CollectionWrapper.toArray().map(callback)\n\t * @param {function} callback Function that is called for every item of the collection.\n\t * @returns {Array} A new array with each element being the result of the callback function.\n\t */\n\tmap(callback) {\n\t\treturn this._array().map(callback);\n\t}\n\n\tsetCollection(collection) {\n\t\tcollection = collection || null;\n\t\tif (this._collection === collection) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet oldList = toArray(this._collection);\n\t\tlet newList = toArray(collection);\n\n\t\tthis._setEventListeners(false);\n\t\tthis._collection = collection || null;\n\t\tthis._setEventListeners(true);\n\n\t\tpatchDiff(oldList, newList,\n\t\t\t(item, n, idx) => this._onAdd({\n\t\t\t\titem,\n\t\t\t\tidx,\n\t\t\t}),\n\t\t\t(item, m, idx) => this._onRemove({\n\t\t\t\titem,\n\t\t\t\tidx,\n\t\t\t})\n\t\t);\n\t}\n\n\t/**\n\t * Attach an event handler function for one or more session events.\n\t * @param {?string} events One or more space-separated events. Null means any event.\n\t * @param {Event~eventCallback} handler A function to execute when the event is emitted.\n\t */\n\ton(events, handler) {\n\t\tthis._checkAutoDispose(1);\n\t\tthis._eventBus.on(this, events, handler, this._namespace);\n\t}\n\n\t/**\n\t * Remove an event handler.\n\t * @param {?string} events One or more space-separated events. Null means any event.\n\t * @param {Event~eventCallback} [handler] An option handler function. The handler will only be remove if it is the same handler.\n\t */\n\toff(events, handler) {\n\t\tthis._checkAutoDispose(-1);\n\t\tthis._eventBus.off(this, events, handler, this._namespace);\n\t}\n\n\t/**\n\t * Returns the item at a given index, or undefined if the index is out of bounds.\n\t * @param {number} idx Zero-based index.\n\t * @returns {*} Item located at the given index.\n\t */\n\tatIndex(idx) {\n\t\tlet s = this._beginIdx();\n\t\tlet e = this._endIdx();\n\t\t// Check out of bounds\n\t\tif (idx < 0 || idx >= e - s) return undefined;\n\n\t\t// Set idx to the filtered internal index\n\t\tidx += s;\n\t\tif (this._filter) {\n\t\t\t// Find the idx:th item\n\t\t\tfor (let c of this._list) {\n\t\t\t\tif (c.f) {\n\t\t\t\t\tif (!idx) {\n\t\t\t\t\t\treturn c.m;\n\t\t\t\t\t}\n\t\t\t\t\tidx--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this._list[idx].m;\n\t}\n\n\t/**\n\t * Returns a zero-based index value of an item in the collection.\n\t * @param {*} item Collection item.\n\t * @returns {number} Zero-based index of the item, or -1 if the item is not found.\n\t */\n\tindexOf(item) {\n\t\tlet s = this._beginIdx();\n\t\tlet e = this._endIdx();\n\t\tif (e > s) {\n\t\t\tif (this._filter) {\n\t\t\t\tlet i = 0;\n\t\t\t\tfor (let c of this._list) {\n\t\t\t\t\tif (c.f) {\n\t\t\t\t\t\tif (c.m === item) {\n\t\t\t\t\t\t\treturn i >= s ? i - s : -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tif (i >= e) break;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (c.m === item) {\n\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (let i = s; i < e; i++) {\n\t\t\t\t\tif (this._list[i].m === item) {\n\t\t\t\t\t\treturn i - s;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\n\t/**\n\t * Refreshes the collection in case sorting, filtering, or mapping has been\n\t * affected by changes.\n\t */\n\trefresh() {\n\t\tif (this._collection) {\n\t\t\tfor (let item of this._collection) {\n\t\t\t\tthis._onChange(null, item);\n\t\t\t}\n\t\t}\n\t}\n\n\t_indexOf(item) {\n\t\tif (this._filter) {\n\t\t\treturn this._fIndexOf(item);\n\t\t}\n\t\tfor (let i = 0; i < this._list.length; i++) {\n\t\t\tlet c = this._list[i];\n\t\t\tif (c.m === item) {\n\t\t\t\treturn { cont: c, idx: i, fidx: i };\n\t\t\t}\n\t\t}\n\t\treturn { cont: null, idx: -1, fidx: -1 };\n\t}\n\n\t_fIndexOf(item) {\n\t\tlet fi = 0;\n\t\tfor (let i = 0; i < this._list.length; i++) {\n\t\t\tlet c = this._list[i];\n\t\t\tif (c.m === item) {\n\t\t\t\treturn { cont: c, idx: i, fidx: fi };\n\t\t\t}\n\t\t\tif (c.f) fi++;\n\t\t}\n\t\treturn { cont: null, idx: -1, fidx: -1 };\n\t}\n\n\t_atFIndex(fidx) {\n\t\tif (this._filter) {\n\t\t\t// Find the fidx:th item\n\t\t\tfor (let c of this._list) {\n\t\t\t\tif (c.f) {\n\t\t\t\t\tif (!fidx) {\n\t\t\t\t\t\treturn c.m;\n\t\t\t\t\t}\n\t\t\t\t\tfidx--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this._list[fidx].m;\n\t}\n\n\t// Returns the begin index based of the filtered internal list.\n\t// Optionally with the length to calculate from.\n\t_beginIdx(l) {\n\t\tif (l === undefined) l = this._len;\n\t\tlet o = this._begin;\n\t\treturn o < 0\n\t\t\t? Math.max(0, l + o)\n\t\t\t: Math.min(l, o);\n\t}\n\n\t// Returns the end index based of the filtered internal list.\n\t// Optionally with the length to calculate from.\n\t_endIdx(l) {\n\t\tif (l === undefined) l = this._len;\n\t\tlet o = this._end;\n\t\tif (o === null) return l;\n\t\treturn o < 0\n\t\t\t? Math.max(0, l + o)\n\t\t\t: Math.min(l, o);\n\t}\n\n\t_array() {\n\t\tlet arr = this._filter\n\t\t\t? this._list.filter(c => c.f)\n\t\t\t: this._list;\n\t\tlet s = this._beginIdx();\n\t\tlet e = this._endIdx();\n\t\tif (s == 0 && e == this._len) {\n\t\t\treturn arr.map(c => c.m);\n\t\t}\n\t\treturn arr.slice(s, e).map(c => c.m);\n\t}\n\n\t_wrapModel(m, item) {\n\t\treturn this._filter\n\t\t\t? { m: m, f: this._filter(item), i: item }\n\t\t\t: { m: m, i: item };\n\t}\n\n\t_setEventListeners(on) {\n\t\tlet c = this._collection;\n\t\tif (!c || typeof c.on !== 'function') {\n\t\t\treturn;\n\t\t}\n\t\tlet cb = on ? 'on' : 'off';\n\t\tc[cb]('add', this._onAdd);\n\t\tc[cb]('remove', this._onRemove);\n\t}\n\n\t_binarySearch(m) {\n\t\treturn array.binarySearch(this._list, { m }, (a, b) => this._compare(a.m, b.m));\n\t}\n\n\t_onChange(_, item) {\n\t\tlet m = this._weakMap\n\t\t\t? this._weakMap.get(item)\n\t\t\t: item;\n\n\t\t// Get current idx of the item.\n\t\tlet { cont, idx, fidx } = this._indexOf(m);\n\t\tif (!cont) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get filtered and new filter value\n\t\tlet f = true;\n\t\tlet nf = true;\n\t\tif (this._filter) {\n\t\t\tf = cont.f;\n\t\t\tnf = this._filter(item);\n\t\t\tcont.f = nf;\n\t\t}\n\n\t\t// Get new mapped item\n\t\tlet nm = m;\n\t\tif (this._map) {\n\t\t\tnm = this._map(item, this._collection);\n\t\t\tif (m !== nm) {\n\t\t\t\tcont.m = nm;\n\t\t\t\tthis._weakMap.set(item, nm);\n\t\t\t}\n\t\t}\n\n\t\t// Check if item moved\n\t\tlet nfidx = fidx;\n\t\tlet moved = this._compare && !(\n\t\t\t(idx === 0 || this._compare(this._list[idx - 1].m, nm) < 0) &&\n\t\t\t(idx === (this._list.length - 1) || this._compare(nm, this._list[idx + 1].m) < 0)\n\t\t);\n\t\tif (moved) {\n\t\t\t// Remove from last position\n\t\t\tthis._list.splice(idx, 1);\n\t\t\tidx = this._binarySearch(nm);\n\t\t\tif (idx < 0) {\n\t\t\t\t// If idx < 0, the value contains the bitwise compliment of where the\n\t\t\t\t// item would fit.\n\t\t\t\tidx = ~idx;\n\t\t\t}\n\t\t\t// Insert in new position\n\t\t\tthis._list.splice(idx, 0, cont);\n\t\t\tnfidx = this._filter\n\t\t\t\t? nf\n\t\t\t\t\t? this._fIndexOf(m).fidx\n\t\t\t\t\t: fidx\n\t\t\t\t: idx;\n\t\t}\n\n\t\t// Early exit if visibility, mapped value, and index is unchanged.\n\t\tif (f === nf && m === nm && fidx === nfidx) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove unless it was previously hidden\n\t\tif (f) {\n\t\t\tthis._len--;\n\t\t\tthis._trySendRemove(m, fidx);\n\t\t}\n\n\t\t// Add unless it is now hidden\n\t\tif (nf) {\n\t\t\tthis._len++;\n\t\t\tthis._trySendAdd(nm, nfidx);\n\t\t}\n\t}\n\n\t_trySendAdd(m, i) {\n\t\tlet l = this._len;\n\t\tlet cur_s = this._beginIdx(l);\n\t\tlet pre_s = this._beginIdx(l - 1);\n\t\tlet cur_e = this._endIdx(l);\n\t\tlet pre_e = this._endIdx(l - 1);\n\n\t\t// Quick escape\n\t\tif (pre_s >= pre_e && cur_s >= cur_e) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (cur_s > pre_s) {\n\t\t\tif (i >= cur_s) {\n\t\t\t\tthis._sendRemove(this._atFIndex(pre_s), 0);\n\t\t\t}\n\t\t} else {\n\t\t\tif (i < cur_s) {\n\t\t\t\tthis._sendAdd(this._atFIndex(cur_s), 0);\n\t\t\t}\n\t\t}\n\n\t\tif (i >= cur_s && i < cur_e) {\n\t\t\tthis._sendAdd(m, i - cur_s);\n\t\t}\n\n\t\tif (cur_e > pre_e) {\n\t\t\tif (i >= cur_e) {\n\t\t\t\tthis._sendAdd(this._atFIndex(cur_e - 1), cur_e - cur_s - 1);\n\t\t\t}\n\t\t} else {\n\t\t\tif (i < cur_e) {\n\t\t\t\tthis._sendRemove(this._atFIndex(cur_e), cur_e - cur_s);\n\t\t\t}\n\t\t}\n\t}\n\n\t_trySendRemove(m, i) {\n\t\tlet l = this._len;\n\t\tlet cur_s = this._beginIdx(l);\n\t\tlet pre_s = this._beginIdx(l + 1);\n\t\tlet cur_e = this._endIdx(l);\n\t\tlet pre_e = this._endIdx(l + 1);\n\n\t\t// Quick escape\n\t\tif (pre_s >= pre_e && cur_s >= cur_e) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (cur_e < pre_e) {\n\t\t\tif (i >= pre_e) {\n\t\t\t\tthis._sendRemove(this._atFIndex(pre_e - 1), pre_e - pre_s - 1);\n\t\t\t}\n\t\t} else {\n\t\t\tif (i < pre_e) {\n\t\t\t\tthis._sendAdd(this._atFIndex(pre_e - 1), pre_e - pre_s);\n\t\t\t}\n\t\t}\n\n\t\tif (i >= pre_s && i < pre_e) {\n\t\t\tthis._sendRemove(m, i - pre_s);\n\t\t}\n\n\t\tif (cur_s < pre_s) {\n\t\t\tif (i > cur_s) {\n\t\t\t\tthis._sendAdd(this._atFIndex(cur_s), 0);\n\t\t\t}\n\t\t} else {\n\t\t\tif (i < cur_s) {\n\t\t\t\tthis._sendRemove(this._atFIndex(cur_s - 1), 0);\n\t\t\t}\n\t\t}\n\t}\n\n\t_sendAdd(item, idx) {\n\t\tthis._eventBus.emit(this, this._namespace + '.add', {\n\t\t\titem,\n\t\t\tidx\n\t\t});\n\t}\n\n\t_sendRemove(item, idx) {\n\t\tthis._eventBus.emit(this, this._namespace + '.remove', {\n\t\t\titem,\n\t\t\tidx\n\t\t});\n\t}\n\n\t_onAdd(e) {\n\t\tif (this._disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet m = this._map\n\t\t\t? this._map(e.item, this._collection)\n\t\t\t: e.item;\n\t\tlet idx = this._compare\n\t\t\t? this._binarySearch(m)\n\t\t\t: e.idx;\n\n\t\tif (this._weakMap) {\n\t\t\tthis._weakMap.set(e.item, m);\n\t\t}\n\n\t\tif (idx < 0) {\n\t\t\t// If idx < 0, the value contains the bitwise compliment of where the\n\t\t\t// item would fit.\n\t\t\tidx = ~idx;\n\t\t}\n\n\t\tlet cont = this._wrapModel(m, e.item);\n\t\tthis._list.splice(idx, 0, cont);\n\n\t\tif (this._listen && e.item.on) {\n\t\t\te.item.on('change', this._onChange);\n\t\t}\n\n\t\tif (this._filter) {\n\t\t\tif (!cont.f) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tidx = this._fIndexOf(m).fidx;\n\t\t}\n\n\t\tthis._len++;\n\t\tthis._trySendAdd(m, idx);\n\t}\n\n\t_onRemove(e) {\n\t\tif (this._disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet m = this._weakMap && this._compare\n\t\t\t? this._weakMap.get(e.item)\n\t\t\t: e.item;\n\t\tlet idx = this._compare\n\t\t\t? this._binarySearch(m)\n\t\t\t: e.idx;\n\n\t\tlet cont = this._list[idx];\n\n\t\tif (this._weakMap) {\n\t\t\tthis._weakMap.delete(e.item);\n\t\t}\n\n\t\tlet fidx = idx;\n\t\tif (this._listen && e.item.on) {\n\t\t\te.item.off('change', this._onChange);\n\t\t}\n\n\t\tif (this._filter) {\n\t\t\t// Quick exit if a filtered item was removed.\n\t\t\tif (!cont.f) {\n\t\t\t\treturn this._list.splice(idx, 1);\n\t\t\t}\n\t\t\tlet r = this._fIndexOf(m);\n\t\t\tif (!r.cont) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfidx = r.fidx;\n\t\t}\n\n\t\tthis._list.splice(idx, 1);\n\t\tthis._len--;\n\t\tthis._trySendRemove(m, fidx);\n\t}\n\n\t_checkAutoDispose(dt) {\n\t\tlet ms = this._autoDispose;\n\t\tif (ms === null) {\n\t\t\treturn;\n\t\t}\n\t\tthis._onCount += dt;\n\t\tif (this._onCount > 0) {\n\t\t\tif (this._timeout) {\n\t\t\t\tclearTimeout(this._timeout);\n\t\t\t\tthis._timeout = null;\n\t\t\t}\n\t\t} else {\n\t\t\tthis._timeout = setTimeout(() => this.dispose(), ms);\n\t\t}\n\t}\n\n\tdispose() {\n\t\tif (this._disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._listen) {\n\t\t\tfor (let cont of this._list) {\n\t\t\t\tlet item = cont.i;\n\t\t\t\tif (item && item.on) {\n\t\t\t\t\titem.off('change', this._onChange);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._setEventListeners(false);\n\t\tdelete this._collection;\n\t\tdelete this._weakMap;\n\t\tthis.disposed = false;\n\t}\n\n\t[Symbol.iterator]() {\n\t\tlet i = 0;\n\t\tlet a;\n\t\tlet arr = this._list;\n\t\tlet done = { done: true };\n\t\tlet s = this._beginIdx();\n\t\tlet e = this._endIdx();\n\t\tlet si = 0;\n\n\t\tif (e <= s) {\n\t\t\treturn { next: function() { return done; } };\n\t\t}\n\n\t\tif (this._filter) {\n\t\t\treturn {\n\t\t\t\tnext: function() {\n\t\t\t\t\twhile (si < e) {\n\t\t\t\t\t\ta = arr[i];\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tif (a.f) {\n\t\t\t\t\t\t\tsi++;\n\t\t\t\t\t\t\tif (si > s) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tvalue: a.m,\n\t\t\t\t\t\t\t\t\tdone: false\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn done;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\ti = s;\n\t\treturn {\n\t\t\tnext: function () {\n\t\t\t\treturn i < e\n\t\t\t\t\t? { value: arr[i++].m, done: false }\n\t\t\t\t\t: done;\n\t\t\t}\n\t\t};\n\t}\n}\n\nexport default CollectionWrapper;\n","import eventBus from 'modapp-eventbus';\nimport { obj } from 'modapp-utils';\n\n/**\n * Model key callback\n * @callback CollectionToModel~modelKeyCallback\n * @param {*} item Collection item\n * @returns {string} Model key for the item. Must be unique for all items in the collection, and should be based on immutable values.\n */\n\n/**\n * A wrapper for a {@link module:modapp~Collection} that exposes an object that implements the {@link module:modapp~Model}\n * interface. It will transparently propagate emitted add and remove events and turn them to change events.\n * @implements {module:modapp~Model}\n */\nclass CollectionToModel {\n\n\t/**\n\t * Creates an CollectionToModel instance.\n\t * @param {object} collection Collection object to wrap.\n\t * @param {CollectionToModel~modelKeyCallback} keyCallback Model key callback function.\n\t * @param {object} [opt] Optional parameters.\n\t * @param {function} [opt.map] Model value map callback. If not provided, model values will be the same as collection items: func(item) -> value\n\t * @param {string} [opt.namespace] Event bus namespace. Defaults to 'collectionToModel'.\n\t * @param {module:modapp~EventBus} [opt.eventBus] Event bus.\n\t */\n\tconstructor(collection, keyCallback, opt = {}) {\n\t\tthis._collection = null;\n\t\tthis._props = {};\n\t\tthis._keyCallback = keyCallback;\n\n\t\tobj.update(this, opt, {\n\t\t\tmap: { type: 'function', default: v => v, property: '_map' },\n\t\t\tnamespace: { type: 'string', default: 'collectionToModel', property: '_namespace' },\n\t\t\teventBus: { type: 'object', default: eventBus, property: '_eventBus' }\n\t\t});\n\n\t\t// Bind callbacks\n\t\tthis._onAdd = this._onAddRemove.bind(this, true);\n\t\tthis._onRemove = this._onAddRemove.bind(this, false);\n\n\t\tthis.setCollection(collection, true);\n\t}\n\n\t/**\n\t * Model properties.\n\t * @returns {object} Anonymous object with all model properties.\n\t */\n\tget props() {\n\t\treturn this._props;\n\t}\n\n\t/**\n\t * Set wrapped collection.\n\t * @param {Collection|Array?} collection Collection to wrap.\n\t * @param {boolean} noEvents If true, no events should be emitted.\n\t * @returns {this}\n\t */\n\tsetCollection(collection, noEvents) {\n\t\tcollection = collection || null;\n\t\tif (this._collection === collection) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._setEventListeners(false);\n\t\tthis._collection = collection;\n\n\t\t// Init props\n\t\tlet o = {};\n\t\tfor (let v of this._collection) {\n\t\t\tlet k = this._keyCallback(v);\n\t\t\to[k] = this._map(v);\n\t\t}\n\n\t\tlet change = {};\n\t\tfor (let k in o) {\n\t\t\tlet mv = o[k];\n\t\t\tif (mv !== this._props[k]) {\n\t\t\t\tchange[k] = this._props[k];\n\t\t\t\tthis._props[k] = mv;\n\t\t\t\tif (this._promote(k)) {\n\t\t\t\t\tthis[k] = mv;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (let k in this._props) {\n\t\t\tif (!o.hasOwnProperty(k)) {\n\t\t\t\tchange[k] = this._props[k];\n\t\t\t\tdelete this._props[k];\n\t\t\t\tif (this._promote(k)) {\n\t\t\t\t\tdelete this[k];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._setEventListeners(true);\n\n\t\tif (!noEvents) {\n\t\t\tthis._eventBus.emit(this, this._namespace + '.change', change);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Get wrapped collection\n\t * @returns {Collection?} Collection\n\t */\n\tgetCollection() {\n\t\treturn this._collection;\n\t}\n\n\t/**\n\t * Attach an event handler function for one or more session events.\n\t * @param {?string} events One or more space-separated events. Null means any event.\n\t * @param {Event~eventCallback} handler A function to execute when the event is emitted.\n\t */\n\ton(events, handler) {\n\t\tthis._eventBus.on(this, events, handler, this._namespace);\n\t}\n\n\t/**\n\t * Remove an event handler.\n\t * @param {?string} events One or more space-separated events. Null means any event.\n\t * @param {Event~eventCallback} [handler] An option handler function. The handler will only be remove if it is the same handler.\n\t */\n\toff(events, handler) {\n\t\tthis._eventBus.off(this, events, handler, this._namespace);\n\t}\n\n\t_setEventListeners(on) {\n\t\tif (!this._collection || !this._collection.on) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (on) {\n\t\t\tthis._collection.on('add', this._onAdd);\n\t\t\tthis._collection.on('remove', this._onRemove);\n\t\t} else {\n\t\t\tthis._collection.off('add', this._onAdd);\n\t\t\tthis._collection.off('remove', this._onRemove);\n\t\t}\n\t}\n\n\t_onAddRemove(isAdd, e) {\n\t\tif (!this._collection) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet v = e.item;\n\t\tlet k = this._keyCallback(v);\n\t\tlet ov = this._props[k];\n\t\tlet mv = this._map(v);\n\n\t\tif (isAdd) {\n\t\t\tthis._props[k] = mv;\n\t\t\tif (this._promote(k)) {\n\t\t\t\tthis[k] = mv;\n\t\t\t}\n\t\t} else {\n\t\t\tdelete this._props[k];\n\t\t\tif (this._promote(k)) {\n\t\t\t\tdelete this[k];\n\t\t\t}\n\t\t}\n\n\t\tthis._eventBus.emit(this, this._namespace + '.change', { [k]: ov });\n\t}\n\n\t_promote(key) {\n\t\treturn (this.hasOwnProperty(key) || typeof this[key] == 'undefined') && key[0] !== '_';\n\t}\n\n\ttoJSON() {\n\t\tlet o = Object.assign({}, this._props);\n\t\tfor (let k in o) {\n\t\t\tvar v = o[k];\n\t\t\tif (typeof v === 'object' && v !== null && v.toJSON) {\n\t\t\t\to[k] = v.toJSON();\n\t\t\t}\n\t\t}\n\t\treturn o;\n\t}\n\n\tdispose() {\n\t\tif (!this._collection) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._setEventListeners(false);\n\t\tdelete this._props;\n\t\tdelete this._collection;\n\t}\n\n}\n\nexport default CollectionToModel;\n","import eventBus from 'modapp-eventbus';\nimport { obj } from 'modapp-utils';\n\nfunction hasProps(m) {\n\treturn m && m.props && typeof m.props == 'object' ? m.props : null;\n}\n\nfunction getProps(m) {\n\tif (!m) {\n\t\treturn null;\n\t}\n\tlet props = hasProps(m);\n\tif (props) {\n\t\treturn props;\n\t}\n\tlet o = {};\n\tfor (let k in m) {\n\t\tif (k && m.hasOwnProperty(k) && k[0] !== '_') {\n\t\t\to[k] = m[k];\n\t\t}\n\t}\n\treturn o;\n}\n\n/**\n * ModifyModel wraps another object or a {@link module:modapp~Model}, and sets\n * its own properties to the match.\n *\n * Any property modification that will cause a difference between the models\n * will set the additional property \"isModified\" to be true.\n *\n * It also listens to changed in the underlying model. If a non-modified\n * property is changed, the ModifyModel will update its own property.\n *\n * Because ModifyModel listens to the underlying model, it needs to be disposed\n * when not used anymore.\n * @implements {module:modapp~Model}\n */\nclass ModifyModel {\n\n\t/**\n\t * Creates a ModifyModel instance\n\t * @param {object|Model} model Model object to wrap.\n\t * @param {object} [opt] Optional parameters.\n\t * @param {object} [opt.definition] Object definition. If not provided, any value will be allowed.\n\t * @param {string} [opt.namespace] Event bus namespace. Defaults to 'modifyModel'.\n\t * @param {object} [opt.isModifiedProperty] Property used to flag if model is modified. Defaults to 'isModified'.\n\t * @param {object} [opt.props] Properties to set initially.\n\t * @param {function} [opt.onChange] Callback called whenever the underlying model has changed. function(this, change)\n\t * @param {module:modapp~EventBus} [opt.eventBus] Event bus.\n\t * @param {boolean} [opt.modifiedOnNew] [opt.modifiedOnNew] Flag telling if model is considered modified on new properties not existing on the wrapped model. Defaults to false.\n\t */\n\tconstructor(model, opt = {}) {\n\t\tthis._model = model;\n\t\tthis._modification = {};\n\n\t\tthis._eventBus = opt.eventBus || eventBus;\n\t\tthis._namespace = opt.namespace || 'modifyModel';\n\t\tthis._definition = opt.definition || null;\n\t\tthis._modProp = opt.hasOwnProperty('isModifiedProperty') ? opt.isModifiedProperty : 'isModified';\n\t\tthis._modifiedOnNew = !!opt.modifiedOnNew;\n\t\tthis._onChange = opt.onChange || null;\n\t\tthis._props = {};\n\n\t\tthis._setIsModified(this._update(getProps(model)));\n\t\tif (opt.props) {\n\t\t\tthis._setIsModified(this._update(opt.props));\n\t\t}\n\n\t\tthis._onCount = 0;\n\t\tthis._timeout = null;\n\n\t\t// Bind callbacks\n\t\tthis._onModelChange = this._onModelChange.bind(this);\n\t\tthis._setEventListener(true);\n\t}\n\n\t/**\n\t * Attach an event handler function for one or more session events.\n\t * @param {?string} events One or more space-separated events. Null means any event.\n\t * @param {Event~eventCallback} handler A function to execute when the event is emitted.\n\t */\n\ton(events, handler) {\n\t\tthis._eventBus.on(this, events, handler, this._namespace);\n\t}\n\n\t/**\n\t * Remove an event handler.\n\t * @param {?string} events One or more space-separated events. Null means any event.\n\t * @param {Event~eventCallback} [handler] An option handler function. The handler will only be remove if it is the same handler.\n\t */\n\toff(events, handler) {\n\t\tthis._eventBus.off(this, events, handler, this._namespace);\n\t}\n\n\t/**\n\t * Sets model properties\n\t * If any property where changed, this will trigger a change event.\n\t * @param {object} props Properties to set\n\t * @returns {Promise} Promise to the setting of the properties.\n\t */\n\tset(props) {\n\t\tlet changed = props ? this._update(props) : null;\n\t\tchanged = this._setIsModified(changed);\n\n\t\tif (changed) {\n\t\t\tthis._eventBus.emit(this, this._namespace + '.change', changed);\n\t\t}\n\n\t\treturn Promise.resolve(changed);\n\t}\n\n\tget props() {\n\t\treturn this._props;\n\t}\n\n\t/**\n\t * Resets a single or all model properties to the underlying model, clearing\n\t * any modifications. If any property where changed or is missing, this will\n\t * trigger a change event.\n\t * @param {string} [prop] Optional property to reset. Defaults to resetting all properties.\n\t * @returns {Promise} Promise to the setting of the properties.\n\t */\n\treset(prop) {\n\t\tlet o = {};\n\t\tlet m = hasProps(this._model) || this._model;\n\t\tif (prop) {\n\t\t\tif (this._modification.hasOwnProperty(prop)) {\n\t\t\t\to[prop] = m[prop];\n\t\t\t}\n\t\t} else {\n\t\t\tfor (let k in this._modification) {\n\t\t\t\to[k] = m[k];\n\t\t\t}\n\t\t}\n\t\treturn this.set(o);\n\t}\n\n\t/**\n\t * Get the modifications in ModifyModel in comparison to the underlying model object.\n\t * @returns {?object} Key/value object with modified properties and their new value. Null if there are no modifications.\n\t */\n\tgetModifications() {\n\t\treturn Object.keys(this._modification).length\n\t\t\t? Object.assign({}, this._modification)\n\t\t\t: null;\n\t}\n\n\tgetModel() {\n\t\treturn this._model;\n\t}\n\n\t_setIsModified(changed) {\n\t\tif (changed) {\n\t\t\tlet v;\n\t\t\tlet m = hasProps(this._model) || this._model;\n\t\t\tfor (let k in changed) {\n\t\t\t\tv = m[k];\n\t\t\t\tif (this._props[k] === v || (!this._modifiedOnNew && typeof v == 'undefined')) {\n\t\t\t\t\tdelete this._modification[k];\n\t\t\t\t} else {\n\t\t\t\t\tthis._modification[k] = this._props[k];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Do we have any modifications\n\t\tif (this._modProp) {\n\t\t\tlet newIsModified = Object.keys(this._modification).length > 0;\n\t\t\tif (newIsModified !== this._props[this._modProp]) {\n\t\t\t\tchanged = changed || {};\n\t\t\t\tchanged[this._modProp] = !newIsModified;\n\t\t\t\tthis._props[this._modProp] = newIsModified;\n\t\t\t\tthis[this._modProp] = newIsModified;\n\t\t\t}\n\t\t}\n\n\t\treturn changed;\n\t}\n\n\t_setEventListener(on) {\n\t\tif (this._model && this._model.on) {\n\t\t\tthis._model[on ? 'on' : 'off']('change', this._onModelChange);\n\t\t}\n\t}\n\n\t_onModelChange(changed) {\n\t\tif (!this._model) return;\n\n\t\tlet m = hasProps(this._model) || this._model;\n\t\tlet props;\n\t\tfor (let k in changed) {\n\t\t\t// If the value isn't modified\n\t\t\tif (!this._modification.hasOwnProperty(k)) {\n\t\t\t\tprops = props || {};\n\t\t\t\tprops[k] = m[k];\n\t\t\t} else {\n\t\t\t\tif (this._props[k] === m[k]) {\n\t\t\t\t\tdelete this._modification[k];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.set(props);\n\t\tif (this._onChange) {\n\t\t\tthis._onChange(this, changed);\n\t\t}\n\t}\n\n\t/**\n\t * Updates the properties.\n\t * @param {object} props Properties to update.\n\t * @returns {?object} Key/value object with the change properties and old values, or null if there were no changes.\n\t * @private\n\t */\n\t_update(props) {\n\t\tif (!props) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet changed = null;\n\t\tlet v, promote;\n\t\tlet p = this._props;\n\n\t\tif (this._definition) {\n\t\t\tchanged = obj.update(p, props, this._definition);\n\t\t\tfor (let key in changed) {\n\t\t\t\tif ((this.hasOwnProperty(key) || !this[key]) && key[0] !== '_') {\n\t\t\t\t\tv = p[key];\n\t\t\t\t\tif (v === undefined) {\n\t\t\t\t\t\tdelete this[key];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis[key] = v;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor (let key in props) {\n\t\t\t\tv = props[key];\n\t\t\t\tpromote = (this.hasOwnProperty(key) || !this[key]) && key[0] !== '_';\n\t\t\t\tif (p[key] !== v) {\n\t\t\t\t\tchanged = changed || {};\n\t\t\t\t\tchanged[key] = p[key];\n\t\t\t\t\tif (v === undefined) {\n\t\t\t\t\t\tdelete p[key];\n\t\t\t\t\t\tif (promote) delete this[key];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tp[key] = v;\n\t\t\t\t\t\tif (promote) this[key] = v;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn changed;\n\t}\n\n\ttoJSON() {\n\t\tif (this._definition) {\n\t\t\treturn obj.copy(this._props, this._definition);\n\t\t}\n\n\t\tlet props = {};\n\t\tlet p = this.props;\n\t\tlet v;\n\t\tfor (let key in p) {\n\t\t\tv = p[k];\n\t\t\tprops[key] = v && typeof v == 'object' && typeof v.toJSON == 'function' ? v.toJSON() : v;\n\t\t}\n\t\treturn props;\n\t}\n\n\tdispose() {\n\t\tthis._setEventListener(false);\n\t\tthis._model = null;\n\t}\n}\n\nexport default ModifyModel;\n","import eventBus from 'modapp-eventbus';\nimport { array } from 'modapp-utils';\nimport { getProps, patchDiff } from './utils';\n\nfunction compare(a, b) {\n\treturn a.key.localeCompare(b.key);\n}\n\n/**\n * ModelToCollection turns a model into a collection.\n */\nclass ModelToCollection {\n\n\t/**\n\t * Creates a ModelToCollection instance.\n\t * @param {object|Model} model Model\n\t * @param {object} [opt] Optional parameters.\n\t * @param {function} [opt.compare] Compare function with receives two objects { key, value }. Defaults to: (a, b) => a.key.localeCompare(b.key)\n\t * @param {function} [opt.filter] Filter function filtering which key/values to show: function(key, value) -> boolean\n\t * @param {string} [opt.namespace] Event bus namespace. Defaults to 'modelToCollection'.\n\t * @param {module:modapp~EventBus} [opt.eventBus] Event bus.\n\t */\n\tconstructor(model, opt) {\n\t\topt = opt || {};\n\t\tthis._compare = opt.compare || compare;\n\t\tthis._namespace = opt.namespace || 'modelToCollection';\n\t\tthis._eventBus = opt.eventBus || eventBus;\n\t\tthis._filter = opt.filter || null;\n\n\t\t// Bind callbacks\n\t\tthis._onChange = this._onChange.bind(this);\n\n\t\t// Init list\n\t\tthis._list = [];\n\t\tthis._props = {};\n\t\tif (this._filter) {\n\t\t\tthis._filtered = {};\n\t\t}\n\t\tthis.setModel(model, false);\n\t}\n\n\tget length() {\n\t\treturn this._list.length;\n\t}\n\n\t/**\n\t * Get wrapped model.\n\t * @returns {object|Model} Model\n\t */\n\tgetModel() {\n\t\treturn this._model;\n\t}\n\n\t/**\n\t * Attach an event handler function for one or more session events.\n\t * @param {?string} events One or more space-separated events. Null means any event.\n\t * @param {Event~eventCallback} handler A function to execute when the event is emitted.\n\t */\n\ton(events, handler) {\n\t\tthis._eventBus.on(this, events, handler, this._namespace);\n\t}\n\n\t/**\n\t * Remove an event handler.\n\t * @param {?string} events One or more space-separated events. Null means any event.\n\t * @param {Event~eventCallback} [handler] An option handler function. The handler will only be remove if it is the same handler.\n\t */\n\toff(events, handler) {\n\t\tthis._eventBus.off(this, events, handler, this._namespace);\n\t}\n\n\t/**\n\t * Retrieves the order index of an item.\n\t * @param {*} item Collection item.\n\t * @returns {number} Order index of the item. -1 if the item id doesn't exist.\n\t */\n\tindexOf(item) {\n\t\tfor (let i = 0; i < this._list.length; i++) {\n\t\t\tif (this._list[i].value === item) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\n\t/**\n\t * Returns the item at a given index.\n\t * @param {number} idx Index position\n\t * @returns {*} Item or undefined if idx is out of bounds.\n\t */\n\tatIndex(idx) {\n\t\treturn idx < 0 || idx >= this._list.length ? undefined : this._list[idx];\n\t}\n\n\t/**\n\t * Returns the collection as an array.\n\t * @returns {Array} Array of items.\n\t */\n\ttoArray() {\n\t\treturn this._list.map(o => o.value);\n\t}\n\n\t/**\n\t * Sets the wrapped model.\n\t * @param {?object} model Model or object to set.\n\t * @param {boolean} noEvents Flag telling if no collection events should be triggered during set.\n\t * @returns {this}\n\t */\n\tsetModel(model, noEvents) {\n\t\tmodel = model || null;\n\t\tif (model === this._model) return this;\n\n\t\tfor (let k in this._props) {\n\t\t\tthis._unlistenItem(this._props[k]);\n\t\t}\n\n\t\tthis._listen(false);\n\t\tthis._model = model;\n\t\tthis._listen(true);\n\n\t\tlet oldList = this._list;\n\t\tthis._list = [];\n\t\tthis._props = {};\n\t\tif (this._filter) {\n\t\t\tthis._filtered = {};\n\t\t}\n\n\t\tif (this._model) {\n\t\t\t// Iterate over props object if available, otherwise the model itself.\n\t\t\tlet p = getProps(this._model);\n\n\t\t\tfor (let k in p) {\n\t\t\t\tlet v = p[k];\n\t\t\t\tlet o = { key: k, value: v };\n\t\t\t\tif (!this._filter || this._filter(k, v)) {\n\t\t\t\t\tthis._list.push(o);\n\t\t\t\t} else {\n\t\t\t\t\tthis._filtered[k] = o;\n\t\t\t\t}\n\t\t\t\tthis._listenItem(o);\n\t\t\t}\n\n\t\t\tthis._list.sort(this._compare);\n\t\t}\n\n\t\tif (!noEvents) {\n\t\t\tthis._sendSyncEvents(oldList, this._list);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t_sendSyncEvents(oldList, newList) {\n\t\tpatchDiff(oldList, newList,\n\t\t\t(o, n, idx) => this._eventBus.emit(this, this._namespace + '.add', {\n\t\t\t\titem: o.value,\n\t\t\t\tidx,\n\t\t\t}),\n\t\t\t(o, m, idx) => this._eventBus.emit(this, this._namespace + '.remove', {\n\t\t\t\titem: o.value,\n\t\t\t\tidx,\n\t\t\t})\n\t\t);\n\t}\n\n\t/**\n\t * Refresh scans through all items to ensure filtering and sorting is\n\t * correct.\n\t * @param {string} [key] Optional key of a single item to refresh.\n\t */\n\trefresh(key) {\n\t\tif (!this._model) return;\n\n\t\t// Start by sorting list, in case the compare is altered.\n\t\tlet oldList = this._list.slice();\n\t\tthis._list.sort(this._compare);\n\n\t\tif (key) {\n\t\t\tlet o = this._props[key];\n\t\t\tif (o) {\n\t\t\t\tthis._onItemChange(o);\n\t\t\t}\n\t\t} else {\n\t\t\tfor (let k in this._props) {\n\t\t\t\tthis._onItemChange(this._props[k]);\n\t\t\t}\n\t\t}\n\n\t\tthis._sendSyncEvents(oldList, this._list);\n\t}\n\n\t_listen(on) {\n\t\tlet cb = on ? 'on' : 'off';\n\t\tif (this._model && this._model[cb]) {\n\t\t\tthis._model[cb]('change', this._onChange);\n\t\t}\n\t}\n\n\t_listenItem(o) {\n\t\tthis._props[o.key] = o;\n\t\tlet m = o.value;\n\t\tif (typeof m === 'object' && m !== null && typeof m.on == 'function') {\n\t\t\to.cb = (m, change) => {\n\t\t\t\tif (this._props[o.key] != o) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlet oldList = this._list.slice();\n\t\t\t\tthis._list.sort(this._compare);\n\t\t\t\tthis._onItemChange(o);\n\n\t\t\t\tthis._sendSyncEvents(oldList, this._list);\n\t\t\t};\n\t\t\tm.on('change', o.cb);\n\t\t}\n\t}\n\n\t_unlistenItem(o) {\n\t\tif (o.cb) {\n\t\t\to.value.off('change', o.cb);\n\t\t\to.cb = null;\n\t\t}\n\t}\n\n\t_onChange(change, m) {\n\t\tif (m !== this._model) return;\n\n\t\tlet oldList = this._list.slice();\n\t\tthis._list.sort(this._compare);\n\n\t\tlet p = getProps(m);\n\n\t\tfor (let k in change) {\n\t\t\tlet nv = p[k];\n\t\t\tlet o = this._props[k];\n\t\t\tlet ov = o ? o.value : undefined;\n\n\t\t\tif (ov === nv) continue;\n\n\t\t\t// Old value undefined means a value was added\n\t\t\tif (typeof ov == 'undefined') {\n\t\t\t\tthis._addItem(k, nv);\n\t\t\t} else if (typeof nv == 'undefined') {\n\t\t\t\tthis._removeItem(k);\n\t\t\t} else {\n\t\t\t\tthis._removeItem(k);\n\t\t\t\tthis._addItem(k, nv);\n\t\t\t}\n\t\t}\n\n\t\tthis._sendSyncEvents(oldList, this._list);\n\t}\n\n\n\t_onItemChange(o) {\n\t\tlet k = o.key;\n\t\tlet v = o.value;\n\t\tlet show = !this._filter || this._filter(k, v);\n\t\t// Check if it is filtered\n\t\tlet f = this._filtered && this._filtered[k];\n\t\tif (f) {\n\t\t\tif (show) {\n\t\t\t\tdelete this._filtered[k];\n\t\t\t\tthis._list.splice(this._insertIdx(o), 0, o);\n\t\t\t}\n\t\t} else {\n\t\t\tif (!show) {\n\t\t\t\tlet idx = this._indexOfItem(o.key, v);\n\t\t\t\tif (idx < 0) {\n\t\t\t\t\tconsole.error(\"Item not in list: \", k, v);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._list.splice(idx, 1);\n\t\t\t\tthis._filtered[k] = o;\n\t\t\t}\n\t\t}\n\t}\n\n\t_addItem(k, item) {\n\t\tlet o = { key: k, value: item };\n\t\tthis._listenItem(o);\n\t\tif (!this._filter || this._filter(k, item)) {\n\t\t\tthis._list.splice(this._insertIdx(o), 0, o);\n\t\t} else {\n\t\t\tthis._filtered[k] = o;\n\t\t}\n\t}\n\n\t_removeItem(k) {\n\t\tlet o = this._props[k];\n\t\tif (!o) {\n\t\t\tconsole.error(\"Item key not found: \", k);\n\t\t\treturn;\n\t\t}\n\t\tdelete this._props[k];\n\t\tthis._unlistenItem(o);\n\n\t\t// Handle hidden item\n\t\tif (this._filtered && this._filtered[k]) {\n\t\t\tdelete this._filtered[k];\n\t\t\treturn;\n\t\t}\n\t\t// Handle visible item\n\t\tlet idx = this._indexOfItem(k, o.value);\n\t\tif (idx < 0) {\n\t\t\tconsole.error(\"Item not in list: \", k, o.value);\n\t\t\treturn;\n\t\t}\n\t\tthis._list.splice(idx, 1);\n\t}\n\n\t_insertIdx(o) {\n\t\tlet idx = array.binarySearch(this._list, o, this._compare);\n\t\treturn idx < 0 ? ~idx : idx; // Use the bitwise complement to get insert index.\n\t}\n\n\t_indexOfItem(k, item) {\n\t\tlet idx = array.binarySearch(this._list, { key: k, value: item }, this._compare);\n\t\t// Verify we found it\n\t\tif (idx >= 0 && this._list[idx].key === k) {\n\t\t\treturn idx;\n\t\t}\n\n\t\t// Binary search failed. Let's scan it instead.\n\t\treturn this._indexOfKey(k);\n\t}\n\n\t_indexOfKey(k) {\n\t\tfor (let i = this._list.length - 1; i >= 0; i--) {\n\t\t\tif (this._list[i].key === k) return i;\n\t\t}\n\t\treturn -1;\n\t}\n\n\tdispose() {\n\t\tthis.setModel(null, true);\n\t}\n\n\t[Symbol.iterator]() {\n\t\tlet i = 0;\n\t\tlet a = this._list;\n\t\tlet l = a.length;\n\n\t\treturn {\n\t\t\tnext: function() {\n\t\t\t\treturn i >= l ? { done: true } : { value: a[i++].value, done: false };\n\t\t\t}\n\t\t};\n\t}\n}\n\nexport default ModelToCollection;\n","import eventBus from 'modapp-eventbus';\nimport Model from './Model';\nimport { getProps } from './utils';\n\n/**\n * A wrapper for a {@link module:modapp~Model}, exposing the underlaying data\n * but can provide mapping of items, or filtering of items. It will\n * transparently propagate emitted change events.\n * @implements {module:modapp~Model}\n */\nclass ModelWrapper extends Model {\n\n\t/**\n\t * Creates an ModelWrapper instance.\n\t * @param {object?} model Model object to wrap.\n\t * @param {object} [opt] Optional parameters.\n\t * @param {function} [opt.map] Model map callback. If not provided, item objects will be stored as is.\n\t * @param {function} [opt.keyMap] Key map callback. If not provided, original key will be used.\n\t * @param {function} [opt.filter] Model filter callback. Parameter is a item of the underlying model.\n\t * @param {function} [opt.dispose] Dispose callback called when a mapped item removed.\n\t * @param {string} [opt.namespace] Event bus namespace. Defaults to 'modelWrapper'.\n\t * @param {module:modapp~EventBus} [opt.eventBus] Event bus.\n\t */\n\tconstructor(model, opt = {}) {\n\t\tsuper(Object.assign({ namespace: 'modelWrapper', eventBus: eventBus }));\n\n\t\tthis._map = opt.map || null;\n\t\tthis._keyMap = opt.keyMap || null;\n\t\tthis._filter = opt.filter || null;\n\t\tthis._dispose = opt.dispose || null;\n\n\t\t// Bind callbacks\n\t\tthis._onChange = this._onChange.bind(this);\n\n\t\tif (this._filter || this._map || this._keyMap) {\n\t\t\tthis._items = {};\n\t\t}\n\n\t\tthis.setModel(model, true);\n\t}\n\n\t/**\n\t * Model properties.\n\t * @returns {object} Anonymous object with all model properties.\n\t */\n\tget props() {\n\t\treturn this._props;\n\t}\n\n\t/**\n\t * Sets model properties on the underlying model.\n\t * @param {object} props Properties to set\n\t * @returns {Promise} Promise to the setting of the properties.\n\t */\n\tset(props) {\n\t\tif (!this._model || typeof this._model.set != 'function') {\n\t\t\tthrow new Error(\"No set method on underlying model.\");\n\t\t}\n\n\t\treturn this._model.set(props);\n\t}\n\n\t/**\n\t * Get wrapped model.\n\t * @returns {object|Model} Model\n\t */\n\tgetModel() {\n\t\treturn this._model;\n\t}\n\n\t/**\n\t * Sets the wrapped model.\n\t * @param {?object} model Model or object to set.\n\t * @param {boolean} noEvents Flag telling if no model change event should be triggered during set.\n\t * @returns {Promise} Promise to the setting of the model.\n\t */\n\tsetModel(model, noEvents) {\n\t\tmodel = model || null;\n\t\tif (model === this._model) return Promise.resolve({});\n\n\t\tlet om = this._model;\n\t\tthis._removeItems();\n\t\tthis._listen(false);\n\t\tthis._model = model || null;\n\t\tthis._listen(true);\n\n\t\tlet p = getProps(this._model);\n\n\t\tlet o = {};\n\t\tif (p) {\n\t\t\tfor (let k in p) {\n\t\t\t\tlet v = p[k];\n\t\t\t\tthis._prep(o, k, v);\n\t\t\t}\n\t\t}\n\n\t\treturn Promise.resolve(super._update(o, !noEvents, !!om));\n\t}\n\n\t/**\n\t * Refreshes the model, or a single property of the model.\n\t * @param {string} [key] Optional key to refresh. All keys are refreshed if omitted.\n\t */\n\trefresh(key) {\n\t\tif (!this._model) return;\n\n\t\tlet p = getProps(this._model);\n\t\tlet o = {};\n\t\tif (key) {\n\t\t\tif (!p.hasOwnProperty(key)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._prep(o, key, p[key]);\n\t\t} else {\n\t\t\tfor (let k in p) {\n\t\t\t\tlet v = p[k];\n\t\t\t\tthis._prep(o, k, v);\n\t\t\t}\n\t\t\tfor (let k in this._props) {\n\t\t\t\tif (!p.hasOwnProperty(k)) {\n\t\t\t\t\tthis._prep(o, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsuper.set(o);\n\t}\n\n\t_listen(on) {\n\t\tlet cb = on ? 'on' : 'off';\n\t\tif (this._model && this._model[cb]) {\n\t\t\tthis._model[cb]('change', this._onChange);\n\t\t}\n\t}\n\n\t_prep(o, k, v) {\n\t\tlet isDefined = typeof v !== 'undefined';\n\t\tlet mk = this._keyMap\n\t\t\t? isDefined && this._keyMap(k, v)\n\t\t\t: k;\n\t\tif (typeof mk != 'string') {\n\t\t\tmk = null;\n\t\t}\n\t\tlet mv = v;\n\t\tlet c = this._items && this._items[k];\n\n\t\tif (isDefined && mk && (!this._filter || this._filter(k, v))) {\n\t\t\tif (this._map) {\n\t\t\t\t// If we map to a disposable value, we do not create a new map\n\t\t\t\t// value, but assume the disposable value will update itself.\n\t\t\t\tmv = this._dispose && c && c.value === v\n\t\t\t\t\t? c.mvalue\n\t\t\t\t\t: this._map(k, v);\n\t\t\t}\n\t\t\to[mk] = mv;\n\t\t} else {\n\t\t\t// Ensure we don't overwrite a new value\n\t\t\tif (mk !== null && !o.hasOwnProperty(mk)) {\n\t\t\t\to[mk] = undefined;\n\t\t\t}\n\t\t}\n\n\t\tc = this._upsertItem(c, k, v, mk, mv);\n\t\tif (c) {\n\t\t\t// Check if value existed, but with a different mapped key\n\t\t\tif (c.mkey !== mk) {\n\t\t\t\tif (!o.hasOwnProperty(c.mkey)) {\n\t\t\t\t\to[c.mkey] = undefined;\n\t\t\t\t}\n\t\t\t\tc.mkey = mk;\n\t\t\t}\n\t\t}\n\t\treturn o;\n\t}\n\n\t_upsertItem(c, k, v, mk, mv) {\n\t\tif (!this._items) return;\n\n\t\t// Check if item already exists.\n\t\tif (c) {\n\t\t\tif (c.value === v) {\n\t\t\t\treturn c;\n\t\t\t}\n\t\t\t// Unlisten to old value\n\t\t\tthis._removeItem(c.key);\n\t\t}\n\n\t\tif (typeof v == 'undefined') {\n\t\t\treturn c;\n\t\t}\n\n\t\tc = { key: k, value: v, mkey: mk, mvalue: mv };\n\t\t// Listen to model values\n\t\tif (typeof v === 'object' && v !== null && typeof v.on == 'function') {\n\t\t\tc.cb = () => {\n\t\t\t\t// Ensure the model still has this property\n\t\t\t\tlet p = getProps(this._model);\n\t\t\t\tlet k = c.key;\n\t\t\t\tif (p && p.hasOwnProperty(k)) {\n\t\t\t\t\tthis._onItemChange(c);\n\t\t\t\t}\n\t\t\t};\n\t\t\tv.on('change', c.cb);\n\t\t}\n\t\tthis._items[k] = c;\n\t\treturn c;\n\t}\n\n\t_removeItem(k) {\n\t\t// Unlisten to old value\n\t\tlet c = this._items[k];\n\t\tif (c) {\n\t\t\tif (c.cb) {\n\t\t\t\tc.value.off('change', c.cb);\n\t\t\t}\n\t\t\tif (this._dispose) {\n\t\t\t\tthis._dispose(k, c.mvalue);\n\t\t\t}\n\t\t\tdelete this._items[k];\n\t\t}\n\t}\n\n\t_onChange(change, m) {\n\t\tif (m !== this._model) return;\n\n\t\tlet p = getProps(m);\n\t\tlet o = {};\n\t\tfor (let k in change) {\n\t\t\tlet v = p[k];\n\t\t\tthis._prep(o, k, v);\n\t\t}\n\n\t\tsuper.set(o);\n\t}\n\n\t_onItemChange(c) {\n\t\tlet p = getProps(this._model);\n\t\t// Ensure the item is still the same\n\t\tif (!p || p[c.key] !== c.value) return;\n\n\t\tsuper.set(this._prep({}, c.key, c.value));\n\t}\n\n\t_removeItems() {\n\t\tif (this._items) {\n\t\t\tfor (let k in this._items) {\n\t\t\t\tthis._removeItem(k);\n\t\t\t}\n\t\t}\n\t}\n\n\tdispose() {\n\t\tthis._removeItems();\n\t\tthis._listen(false);\n\t\tthis._model = null;\n\t}\n}\n\nexport default ModelWrapper;\n","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * A component wrapper that creates a context on render, which can be properly\n * disposed on unrender.\n */\nvar Context = /*#__PURE__*/function () {\n /**\n * Creates an instance of Context\n * @param {function} ctxCreate Context create callback that should return the context object: function(this) -> ctx\n * @param {function} ctxDispose Context dispose callback that gets the context object to dispose: function(ctx, this)\n * @param {function} componentFactory Component factory callback that gets the context object and returns a component: function(ctx, this)\n */\n function Context(ctxCreate, ctxDispose, componentFactory) {\n _classCallCheck(this, Context);\n this._create = ctxCreate;\n this._dispose = ctxDispose;\n this._factory = componentFactory;\n this._ctx = null;\n this._component = null;\n this._rendered = false;\n }\n\n /**\n * Gets the current context.\n * @returns {?object} Current context or null if the Context isn't rendered.\n */\n _createClass(Context, [{\n key: \"getContext\",\n value: function getContext() {\n return this._ctx;\n }\n\n /**\n * Gets the currently rendered component.\n * @returns {?Component} Current component or null if the component isn't rendered.\n */\n }, {\n key: \"getComponent\",\n value: function getComponent() {\n return this._component;\n }\n }, {\n key: \"render\",\n value: function render(el) {\n this._ctx = this._create && this._create(this) || null;\n this._component = this._factory && this._factory(this._ctx, this) || null;\n this._rendered = true;\n if (!this._component) {\n return null;\n }\n return this._component.render(el);\n }\n }, {\n key: \"unrender\",\n value: function unrender() {\n if (this._rendered) {\n this._rendered = false;\n if (this._component) {\n this._component.unrender();\n }\n this._component = null;\n if (this._dispose) {\n this._dispose(this._ctx, this);\n }\n this._ctx = null;\n }\n }\n }]);\n return Context;\n}();\nexport default Context;","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nimport { anim } from 'modapp-utils';\nimport RootElem from './RootElem';\nimport { translate, onLocaleUpdate, offLocaleUpdate } from './utils/l10n';\n\n/**\n * A html component\n */\nvar Html = /*#__PURE__*/function (_RootElem) {\n _inherits(Html, _RootElem);\n var _super = _createSuper(Html);\n /**\n * Creates an instance of Html\n * @param {string|LocaleString} html HTML string\n * @param {object} [opt] Optional parameters.\n * @param {string} [opt.tagName] Tag name (eg. 'span') for the element. Defaults to 'div'.\n * @param {string} [opt.className] Class name\n * @param {object} [opt.attributes] Key/value attributes object\n * @param {object} [opt.events] Key/value events object, where the key is the event name, and value is the callback.\n */\n function Html(html, opt) {\n var _this;\n _classCallCheck(this, Html);\n opt = Object.assign({\n tagName: 'div'\n }, opt);\n _this = _super.call(this, opt.tagName, opt);\n _this.html = html || \"\";\n _this.animId = null;\n _this.rendered = null;\n\n // Bind callbacks\n _this._handleChange = _this._handleChange.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n /**\n * Sets the html\n * @param {string} html HTML string\n * @returns {this}\n */\n _createClass(Html, [{\n key: \"setHtml\",\n value: function setHtml(html) {\n html = html || \"\";\n if (this.html !== html) {\n var tmp = this.html;\n this.html = html;\n if (_get(_getPrototypeOf(Html.prototype), \"getElement\", this).call(this)) {\n offLocaleUpdate(tmp);\n this._handleChange();\n onLocaleUpdate(this.html);\n }\n }\n return this;\n }\n }, {\n key: \"render\",\n value: function render(el) {\n var nodeEl = _get(_getPrototypeOf(Html.prototype), \"render\", this).call(this, el);\n this.rendered = translate(this.html);\n nodeEl.innerHTML = this.rendered;\n onLocaleUpdate(this.html, this._handleChange);\n return nodeEl;\n }\n }, {\n key: \"unrender\",\n value: function unrender() {\n offLocaleUpdate(this.html, this._handleChange);\n anim.stop(this.animId);\n _get(_getPrototypeOf(Html.prototype), \"unrender\", this).call(this);\n this.rendered = null;\n }\n }, {\n key: \"_handleChange\",\n value: function _handleChange() {\n var _this2 = this;\n var el = _get(_getPrototypeOf(Html.prototype), \"getElement\", this).call(this);\n if (!el) {\n return;\n }\n anim.stop(this.animId);\n var next = translate(this.html);\n if (this.rendered === next) {\n this.animId = anim.fade(el, 1);\n return;\n }\n this.animId = anim.fade(el, 0, {\n callback: function callback() {\n var el = _get(_getPrototypeOf(Html.prototype), \"getElement\", _this2).call(_this2);\n if (!el) {\n return;\n }\n _this2.rendered = next;\n el.innerHTML = next;\n _this2.animId = anim.fade(el, 1);\n }\n });\n }\n }]);\n return Html;\n}(RootElem);\nexport default Html;","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nimport RootElem from './RootElem';\n\n/**\n * A input component\n */\nvar Input = /*#__PURE__*/function (_RootElem) {\n _inherits(Input, _RootElem);\n var _super = _createSuper(Input);\n /**\n * Creates an instance of Input\n * @param {string} value Initial value.\n * @param {object} [opt] Optional parameters.\n * @param {string} [opt.className] Class name\n * @param {object} [opt.attributes] Key/value attributes object\n * @param {object} [opt.events] Key/value events object, where the key is the event name, and value is the callback.\n */\n function Input(value, opt) {\n _classCallCheck(this, Input);\n opt = Object.assign({\n attributes: null,\n properties: null\n }, opt);\n opt.attributes = Object.assign({\n type: 'text'\n }, opt.attributes, {\n value: value\n });\n opt.properties = Object.assign({}, opt.properties, {\n value: value\n });\n return _super.call(this, 'input', opt);\n }\n\n /**\n * Gets the value\n * @returns {string}\n */\n _createClass(Input, [{\n key: \"getValue\",\n value: function getValue() {\n return this.getProperty('value');\n }\n\n /**\n * Sets the value\n * @param {string} value Value\n * @returns {this}\n */\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n this.setProperty('value', value);\n return this;\n }\n }]);\n return Input;\n}(RootElem);\nexport default Input;","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nimport RootElem from './RootElem';\n\n/**\n * A textarea component\n */\nvar Textarea = /*#__PURE__*/function (_RootElem) {\n _inherits(Textarea, _RootElem);\n var _super = _createSuper(Textarea);\n /**\n * Creates an instance of Textarea\n * @param {string} value Initial value.\n * @param {object} [opt] Optional parameters.\n * @param {string} [opt.className] Class name\n * @param {object} [opt.attributes] Key/value attributes object\n * @param {object} [opt.events] Key/value events object, where the key is the event name, and value is the callback.\n */\n function Textarea(value, opt) {\n var _this;\n _classCallCheck(this, Textarea);\n _this = _super.call(this, 'textarea', opt);\n _this.value = value || \"\";\n _this.rendered = null;\n return _this;\n }\n\n /**\n * Gets the value\n * @returns {string}\n */\n _createClass(Textarea, [{\n key: \"getValue\",\n value: function getValue() {\n var el = _get(_getPrototypeOf(Textarea.prototype), \"getElement\", this).call(this);\n return el ? el.value : this.value;\n }\n\n /**\n * Sets the value\n * @param {string} value Value\n * @returns {this}\n */\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n value = value || \"\";\n var el = _get(_getPrototypeOf(Textarea.prototype), \"getElement\", this).call(this);\n if (el) {\n el.value = value;\n } else {\n this.value = value;\n }\n return this;\n }\n }, {\n key: \"render\",\n value: function render(el) {\n var nodeEl = _get(_getPrototypeOf(Textarea.prototype), \"render\", this).call(this, el);\n nodeEl.value = this.value;\n return nodeEl;\n }\n }, {\n key: \"unrender\",\n value: function unrender() {\n var el = _get(_getPrototypeOf(Textarea.prototype), \"getElement\", this).call(this);\n if (el) {\n _get(_getPrototypeOf(Textarea.prototype), \"unrender\", this).call(this);\n this.value = el.value;\n this.rendered = null;\n }\n }\n }]);\n return Textarea;\n}(RootElem);\nexport default Textarea;","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { anim, elem } from 'modapp-utils';\n\n/**\n * A component used for doing transition between one component to another.\n * @module component/Transition\n */\nvar Transition = /*#__PURE__*/function () {\n /**\n * Creates a Transition\n * @constructor\n * @alias module:component/Transition\n * @param {object} [opt] Optional parameters\n * @param {string} [opt.className] Classname.\n * @param {number} [opt.distance] Swipe distance in pixels. Defaults to 64.\n * @param {number} [opt.duration] Swipe duration in milliseconds. Defaults to 150.\n * @param {string} [opt.mode] Transition container mode. Defaults to 'flex'.\n */\n function Transition() {\n var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, Transition);\n this.opt = Object.assign({\n mode: 'flex'\n }, opt);\n this.div = null;\n this.animId = null;\n this.current = null;\n this.rendered = null;\n this.contDiv = null;\n }\n _createClass(Transition, [{\n key: \"id\",\n get: function get() {\n return this.current ? this.current.id : undefined;\n }\n }, {\n key: \"render\",\n value: function render(el) {\n if (this.div) throw \"Component already rendered\";\n this.div = elem.create('div', {\n className: this.opt.className,\n attributes: {\n style: 'position: relative; overflow: hidden;' + (this.opt.mode == 'flex' ? ' flex: 1 1 0px;' : '')\n }\n });\n elem.append(el, this.div);\n this._renderComponent();\n return this.div;\n }\n }, {\n key: \"unrender\",\n value: function unrender() {\n if (!this.div) return;\n anim.stop(this.animId);\n this.animId = null;\n this._unrenderComponent();\n elem.remove(this.div);\n this.div = null;\n }\n\n /**\n * Get the current component\n * @returns {object}\n */\n }, {\n key: \"getComponent\",\n value: function getComponent() {\n return this.current;\n }\n\n /**\n * Fade to a new component\n * @param {object} component The component to fade to\n * @returns {this}\n */\n }, {\n key: \"fade\",\n value: function fade(component) {\n this._setComponent(component, 0);\n return this;\n }\n\n /**\n * Slide left to a new component\n * @param {object} component The component to slide to\n * @returns {this}\n */\n }, {\n key: \"slideLeft\",\n value: function slideLeft(component) {\n this._setComponent(component, -1);\n return this;\n }\n\n /**\n * Slide right to a new component\n * @param {object} component The component to slide to\n * @returns {this}\n */\n }, {\n key: \"slideRight\",\n value: function slideRight(component) {\n this._setComponent(component, 1);\n return this;\n }\n\n /**\n * Set a new component\n * @param {object} component The component to use\n * @returns {this}\n */\n }, {\n key: \"set\",\n value: function set(component) {\n component = component || null;\n\n // Is the component already current?\n if (this._isEqual(this.current, component)) return this;\n this.current = component;\n if (!this.div) return this;\n this.animId = anim.stop(this.animId);\n\n // Is the component already rendered?\n if (this._isEqual(this.rendered, component)) {\n this.contDiv.style.opacity = '';\n this.contDiv.style.left = '';\n } else {\n // Unrender previously rendered component\n this._unrenderComponent();\n // Render the current component\n this._renderComponent();\n }\n return this;\n }\n }, {\n key: \"_setComponent\",\n value: function _setComponent(component, direction) {\n var _this = this;\n component = component || null;\n\n // Is the component already current?\n if (this._isEqual(this.current, component)) return;\n this.current = component;\n if (!this.div) return;\n this.animId = anim.stop(this.animId);\n\n // Check if the rendered page matches the one we want\n if (this._isEqual(this.rendered, this.current)) {\n // Swipe it back in from current state\n this.animId = anim.swipeIn(this.contDiv, direction, {\n reset: false,\n callback: function callback() {\n return _this.animId = null;\n },\n duration: this.opt.duration,\n distance: this.opt.distance\n });\n return;\n }\n\n // No rendered component. We can just render the new one.\n if (!this.rendered) {\n this._renderComponent(direction);\n return;\n }\n\n // Unrender the currently rendered tab\n this.animId = anim.swipeOut(this.contDiv, direction, {\n reset: false,\n callback: function callback() {\n _this._unrenderComponent();\n _this._renderComponent(direction);\n },\n duration: this.opt.duration,\n distance: this.opt.distance\n });\n }\n }, {\n key: \"_isEqual\",\n value: function _isEqual(componentA, componentB) {\n if (componentA === componentB) return true;\n if (!componentA || !componentB) return false;\n if (!componentA.hasOwnProperty('id') || !componentB.hasOwnProperty('id')) return false;\n return componentA.id === componentB.id;\n }\n }, {\n key: \"_unrenderComponent\",\n value: function _unrenderComponent() {\n if (!this.rendered) return;\n if (this.rendered.unrender) {\n this.rendered.unrender();\n }\n this.contDiv = null;\n this.rendered = null;\n elem.empty(this.div);\n }\n }, {\n key: \"_renderComponent\",\n value: function _renderComponent(direction) {\n var _this2 = this;\n if (!this.current) return;\n\n // Create container div in which content will be rendered\n var div = elem.append(this.div, elem.create('div', {\n attributes: {\n style: 'width: 100%; height: 100%; position: relative; overflow: auto;'\n }\n }));\n this.current.render(div);\n this.rendered = this.current;\n this.contDiv = div;\n if (typeof direction == 'number') {\n this.animId = anim.swipeIn(this.contDiv, direction, {\n callback: function callback() {\n return _this2.animId = null;\n },\n duration: this.opt.duration,\n distance: this.opt.distance\n });\n }\n }\n }]);\n return Transition;\n}();\nexport default Transition;","/**\n * A module with HTMLElement helper functions\n */\n\n/**\n * Creates a new document element\n * @param {string} tagName Name of the tag. Eg. 'div'.\n * @param {object=} opt Options\n * @param {string} [opt.className] Class name or space separated class names.\n * @param {Object.} [opt.attributes] Attributes object where key is the attribute name and value is the attribute value.\n * @param {Object.} [opt.events] Events object where key is the event name and value is the event callback.\n * @param {Array.} [opt.children] Array of child elements to append.\n * @param {string} [opt.text] Text content. Ignored if children is set.\n * @returns {HTMLElement} Created document element.\n */\nexport var create = function create(tagName, opt) {\n var el = document.createElement(tagName);\n if (opt) {\n var o = opt.attributes;\n if (o) {\n for (var key in o) {\n if (o.hasOwnProperty(key)) {\n el.setAttribute(key, o[key]);\n }\n }\n }\n o = opt.className;\n if (o) {\n el.className = o;\n }\n o = opt.events;\n if (o) {\n for (var _key in o) {\n if (o.hasOwnProperty(_key)) {\n el.addEventListener(_key, o[_key]);\n }\n }\n }\n o = opt.children;\n if (o) {\n for (var i = 0; i < o.length; i++) {\n el.appendChild(o[i]);\n }\n } else if (opt.text) {\n el.textContent = opt.text;\n }\n }\n return el;\n};\n\n/**\n * Appends a child to a parent element\n * @param {?HTMLElement} parent Parent element. If null or undefined, nothing will be performed.\n * @param {?HTMLElement} child Child element. If null or undefined, nothing will be performed.\n * @returns {?HTMLElement} The appended child.\n */\nexport var append = function append(parent, child) {\n if (!parent || !child) {\n return child || null;\n }\n return parent.appendChild(child);\n};\n\n/**\n * Removes an element from the parent element\n * @param {?HTMLElement} child Child element. If null or undefined, nothing will be performed.\n * @param {object=} opt Options\n * @param {Object.} [opt.events] Events object previously used when creating the element. By calling removeEventListener, memory leaks can be prevented on older browsers.\n * @returns {?HTMLElement} Child element.\n */\nexport var remove = function remove(child, opt) {\n if (!child) {\n return null;\n }\n if (opt) {\n var o = opt.events;\n if (o) {\n for (var key in o) {\n if (o.hasOwnProperty(key)) {\n el.removeEventListener(key, o[key]);\n }\n }\n }\n }\n if (!child.parentNode) {\n return child;\n }\n return child.parentNode.removeChild(child);\n};\n\n/**\n * Empties an element of all child nodes.\n * @param {?HTMLElement} element Element\n * @returns {?HTMLElement} ELement.\n */\nexport var empty = function empty(element) {\n if (!element) {\n return element || null;\n }\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n return element;\n};","var map = {\n\t\"./clientBoot/ClientBoot.js\": 13703\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 14280;","'use strict';\nvar $forEach = require('../internals/array-iteration').forEach;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\n\nvar STRICT_METHOD = arrayMethodIsStrict('forEach');\n\n// `Array.prototype.forEach` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.foreach\nmodule.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n// eslint-disable-next-line es/no-array-prototype-foreach -- safe\n} : [].forEach;\n","'use strict';\nvar $ = require('../internals/export');\nvar $map = require('../internals/array-iteration').map;\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');\n\n// `Array.prototype.map` method\n// https://tc39.es/ecma262/#sec-array.prototype.map\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n map: function map(callbackfn /* , thisArg */) {\n return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\nvar toString = require('../internals/to-string');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/iterator-define');\nvar createIterResultObject = require('../internals/create-iter-result-object');\n\nvar STRING_ITERATOR = 'String Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);\n\n// `String.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-string.prototype-@@iterator\ndefineIterator(String, 'String', function (iterated) {\n setInternalState(this, {\n type: STRING_ITERATOR,\n string: toString(iterated),\n index: 0\n });\n// `%StringIteratorPrototype%.next` method\n// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next\n}, function next() {\n var state = getInternalState(this);\n var string = state.string;\n var index = state.index;\n var point;\n if (index >= string.length) return createIterResultObject(undefined, true);\n point = charAt(string, index);\n state.index += point.length;\n return createIterResultObject(point, false);\n});\n","'use strict';\nvar global = require('../internals/global');\nvar DOMIterables = require('../internals/dom-iterables');\nvar DOMTokenListPrototype = require('../internals/dom-token-list-prototype');\nvar forEach = require('../internals/array-for-each');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nvar handlePrototype = function (CollectionPrototype) {\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {\n createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);\n } catch (error) {\n CollectionPrototype.forEach = forEach;\n }\n};\n\nfor (var COLLECTION_NAME in DOMIterables) {\n if (DOMIterables[COLLECTION_NAME]) {\n handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype);\n }\n}\n\nhandlePrototype(DOMTokenListPrototype);\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\tid: moduleId,\n\t\tloaded: false,\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// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(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__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"\" + ({\"32\":\"overseer\",\"44\":\"moderator\",\"298\":\"greeting\",\"611\":\"staff\",\"621\":\"supporter\",\"624\":\"builder\",\"700\":\"bonus\",\"792\":\"main\",\"807\":\"helper\",\"884\":\"admin\",\"935\":\"pioneer\"}[chunkId] || chunkId) + \".\" + {\"32\":\"a4f42cb4\",\"44\":\"225f0b74\",\"298\":\"c604e6e2\",\"378\":\"99171354\",\"553\":\"87cc34fa\",\"611\":\"afa488d1\",\"621\":\"98adeb51\",\"624\":\"be954288\",\"700\":\"f8f4f601\",\"792\":\"8f91f920\",\"807\":\"8e9318c6\",\"884\":\"b04f2d1d\",\"935\":\"40e39e02\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"\" + {\"32\":\"overseer\",\"44\":\"moderator\",\"298\":\"greeting\",\"621\":\"supporter\",\"624\":\"builder\",\"700\":\"bonus\",\"792\":\"main\",\"807\":\"helper\",\"884\":\"admin\",\"935\":\"pioneer\"}[chunkId] + \".\" + {\"32\":\"9aa5bc03\",\"44\":\"98f4464d\",\"298\":\"3c8876e7\",\"621\":\"53bc614f\",\"624\":\"d1c85a27\",\"700\":\"79dbaca7\",\"792\":\"b12a32d4\",\"807\":\"e519e96b\",\"884\":\"912d195d\",\"935\":\"cae19120\"}[chunkId] + \".css\";\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__.hmd = function(module) {\n\tmodule = Object.create(module);\n\tif (!module.children) module.children = [];\n\tObject.defineProperty(module, 'exports', {\n\t\tenumerable: true,\n\t\tset: function() {\n\t\t\tthrow new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);\n\t\t}\n\t});\n\treturn module;\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(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};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","if (typeof document === \"undefined\") return;\nvar createStylesheet = function(chunkId, fullhref, oldTag, resolve, reject) {\n\tvar linkTag = document.createElement(\"link\");\n\n\tlinkTag.rel = \"stylesheet\";\n\tlinkTag.type = \"text/css\";\n\tvar onLinkComplete = function(event) {\n\t\t// avoid mem leaks.\n\t\tlinkTag.onerror = linkTag.onload = null;\n\t\tif (event.type === 'load') {\n\t\t\tresolve();\n\t\t} else {\n\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\tvar realHref = event && event.target && event.target.href || fullhref;\n\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + realHref + \")\");\n\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n\t\t\terr.type = errorType;\n\t\t\terr.request = realHref;\n\t\t\tif (linkTag.parentNode) linkTag.parentNode.removeChild(linkTag)\n\t\t\treject(err);\n\t\t}\n\t}\n\tlinkTag.onerror = linkTag.onload = onLinkComplete;\n\tlinkTag.href = fullhref;\n\n\tif (oldTag) {\n\t\toldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling);\n\t} else {\n\t\tdocument.head.appendChild(linkTag);\n\t}\n\treturn linkTag;\n};\nvar findStylesheet = function(href, fullhref) {\n\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n\tfor(var i = 0; i < existingLinkTags.length; i++) {\n\t\tvar tag = existingLinkTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return tag;\n\t}\n\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n\tfor(var i = 0; i < existingStyleTags.length; i++) {\n\t\tvar tag = existingStyleTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\");\n\t\tif(dataHref === href || dataHref === fullhref) return tag;\n\t}\n};\nvar loadStylesheet = function(chunkId) {\n\treturn new Promise(function(resolve, reject) {\n\t\tvar href = __webpack_require__.miniCssF(chunkId);\n\t\tvar fullhref = __webpack_require__.p + href;\n\t\tif(findStylesheet(href, fullhref)) return resolve();\n\t\tcreateStylesheet(chunkId, fullhref, null, resolve, reject);\n\t});\n}\n// object to store loaded CSS chunks\nvar installedCssChunks = {\n\t524: 0\n};\n\n__webpack_require__.f.miniCss = function(chunkId, promises) {\n\tvar cssChunks = {\"32\":1,\"44\":1,\"298\":1,\"621\":1,\"624\":1,\"700\":1,\"792\":1,\"807\":1,\"884\":1,\"935\":1};\n\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n\t\tpromises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(function() {\n\t\t\tinstalledCssChunks[chunkId] = 0;\n\t\t}, function(e) {\n\t\t\tdelete installedCssChunks[chunkId];\n\t\t\tthrow e;\n\t\t}));\n\t}\n};\n\n// no hmr","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t524: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmucklet_client\"] = self[\"webpackChunkmucklet_client\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [322,3], function() { return __webpack_require__(58113); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","inProgress","dataWebpackPrefix","_Html","_inherits","PoliciesBody","_super","_createSuper","module","html","_this","_classCallCheck","call","className","_policies","self","availablePolicies","map","p","slug","onClick","_onClick","bind","_assertThisInitialized","links","key","value","el","_step","rel","_get","_getPrototypeOf","prototype","_iterator","_createForOfIteratorHelper","this","s","n","done","_step2","_iterator2","getElementsByClassName","l","setAttribute","addEventListener","push","err","e","f","_step3","_iterator3","_step4","_iterator4","removeEventListener","policy","ev","openPolicy","preventDefault","Html","Policies","app","params","require","_init","Object","assign","get","indexOf","console","error","url","escapeHtml","fetch","then","response","json","data","close","screen","removeSubcomponent","addSubcomponent","ScreenDialog","Elem","elem","component","created","Txt","l10n","t","date","formatDate","Date","showYear","tagName","body","events","click","size","title","model","off","_onModelChange","_onUnsubscribe","serviceWorkerSupported","navigator","namespace","ServiceWorker","disableWorker","_onMessage","_tagOnClick","promise","Promise","reject","resolve","_register","handler","eventBus","on","updateServiceWorker","_caches","_this2","caches","keys","delete","registration","update","reload","opt","_this3","tag","Math","random","toString","substring","now","active","postMessage","method","_ev$data","event","_handleNotificationclick","_ev$params","cb","emit","_this4","log","serviceWorker","register","catch","registrationError","_this$registration","_this5","unregister","success","_unregister","modules","api","Api","auth","Auth","Screen","policies","req","forEach","match","name","charAt","toLowerCase","slice","Error","concat","default","AppExt","moduleConfig","props","window","appProps","loadBundle","initModules","result","render","document","ErrorScreenDialog","onClose","_redirect","ConfirmScreenDialog","titleTxt","confirm","buttonTxt","infoTxt","code","message","onConfirm","unrender","redirect","redirectUrl","location","href","split","txtErrorAuthenticating","txtTryAgain","ClientBoot","Model","connected","authenticated","mainModulesPromise","greetingModulesPromise","_tryAuthenticate","q","uri","JSON","parse","atob","Err","_showError","authenticate","user","set","_ref","mainModules","_ref2","greetingModules","onLine","_showOffline","setComponent","escapeMap","repl","c","str","replace","months","getDate","getMonth","getFullYear","cbs","forced","locationReload","clearQuery","force","setTimeout","addBeforeUnload","removeBeforeUnload","filter","o","found","clearCache","headers","includeQuery","pushHistory","idx","chrsz","safe_add","x","y","lsw","S","X","R","Ch","z","Maj","Sigma0256","Sigma1256","Gamma0256","core_sha256","m","a","b","d","g","h","T1","T2","K","Array","HASH","W","i","length","j","str2binb","bin","charCodeAt","Utf8Encode","string","utftext","String","fromCharCode","binb2base64","binarray","bytes","Uint8Array","apply","btoa","Buffer","from","computeBlockSizedKey","len","hash","blockSize","xor","append","alen","blen","sha256","hmacsha256","bkey","outer_key","inner","publicPepper","Collection","constructor","obj","compare","type","modelFactory","idAttribute","id","_modelFactory","_idAttribute","_namespace","_eventBus","_map","SortedMap","item","_addItem","add","remove","removeAtIndex","splice","move","atIndex","toArray","Symbol","iterator","next","sortOrderCompare","sortOrder","CollectionWrapper","collection","_collection","property","begin","end","autoDispose","_weakMap","WeakMap","_onAdd","_onRemove","_listen","_filter","_compare","_onChange","_onCount","_timeout","_disposed","_initList","_setEventListeners","_checkAutoDispose","_list","_len","getModel","_wrapModel","sort","_beginIdx","_endIdx","getCollection","toJSON","_array","callback","setCollection","oldList","newList","patchDiff","refresh","_indexOf","_fIndexOf","cont","fidx","fi","_atFIndex","undefined","_begin","max","min","_end","arr","_binarySearch","array","_","nf","nm","nfidx","_trySendRemove","_trySendAdd","cur_s","pre_s","cur_e","pre_e","_sendRemove","_sendAdd","r","dt","ms","_autoDispose","clearTimeout","dispose","disposed","si","keyCallback","_props","_keyCallback","v","_onAddRemove","noEvents","change","k","mv","_promote","hasOwnProperty","isAdd","ov","hasProps","_model","_modification","_definition","definition","_modProp","isModifiedProperty","_modifiedOnNew","modifiedOnNew","onChange","_setIsModified","_update","getProps","_setEventListener","changed","reset","prop","getModifications","newIsModified","promote","localeCompare","ModelToCollection","_filtered","setModel","_unlistenItem","_listenItem","_sendSyncEvents","_onItemChange","nv","_removeItem","show","_insertIdx","_indexOfItem","_indexOfKey","ModelWrapper","super","_keyMap","keyMap","_dispose","_items","om","_removeItems","_prep","isDefined","mk","mvalue","_upsertItem","mkey","_typeof","_defineProperties","target","descriptor","enumerable","configurable","writable","defineProperty","input","prim","toPrimitive","res","hint","TypeError","_toPrimitive","Context","ctxCreate","ctxDispose","componentFactory","instance","Constructor","_create","_factory","_ctx","_component","_rendered","protoProps","Reflect","receiver","base","object","_superPropBase","desc","getOwnPropertyDescriptor","arguments","_setPrototypeOf","setPrototypeOf","__proto__","ReferenceError","getPrototypeOf","_RootElem","subClass","superClass","create","Derived","hasNativeReflectConstruct","construct","sham","Proxy","Boolean","valueOf","_isNativeReflectConstruct","Super","NewTarget","_possibleConstructorReturn","animId","rendered","_handleChange","tmp","nodeEl","innerHTML","RootElem","Input","attributes","properties","getProperty","setProperty","Textarea","Transition","mode","div","current","contDiv","style","_renderComponent","_unrenderComponent","_setComponent","_isEqual","opacity","left","direction","duration","distance","componentA","componentB","createElement","_key","children","appendChild","text","textContent","parent","child","parentNode","removeChild","empty","element","firstChild","webpackContext","webpackContextResolve","__webpack_require__","exports","$forEach","STRICT_METHOD","arrayMethodIsStrict","callbackfn","$","$map","proto","arrayMethodHasSpeciesSupport","InternalStateModule","defineIterator","createIterResultObject","STRING_ITERATOR","setInternalState","getInternalState","getterFor","iterated","index","point","state","global","DOMIterables","DOMTokenListPrototype","createNonEnumerableProperty","handlePrototype","CollectionPrototype","COLLECTION_NAME","__webpack_module_cache__","moduleId","cachedModule","loaded","__webpack_modules__","O","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","every","getter","__esModule","chunkId","all","reduce","promises","u","miniCssF","globalThis","Function","hmd","script","needAttach","scripts","getElementsByTagName","getAttribute","charset","timeout","nc","src","onScriptComplete","prev","onerror","onload","doneFns","head","toStringTag","scriptUrl","importScripts","currentScript","toUpperCase","test","installedCssChunks","miniCss","fullhref","existingLinkTags","dataHref","existingStyleTags","findStylesheet","oldTag","linkTag","errorType","realHref","request","createStylesheet","loadStylesheet","installedChunks","installedChunkData","realSrc","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","__webpack_exports__"],"sourceRoot":""}