Bundled output for commit 44e165a357 [skip ci]

This commit is contained in:
Gandalf-the-Bot 2018-04-23 11:54:15 +00:00
parent 44e165a357
commit 117fac91a7
3 changed files with 148 additions and 121 deletions

View file

@ -18,7 +18,7 @@ mithril.js [![NPM Version](https://img.shields.io/npm/v/mithril.svg)](https://ww
## What is Mithril?
A modern client-side Javascript framework for building Single Page Applications. It's small (<!-- size -->8.34 KB<!-- /size --> gzipped), fast and provides routing and XHR utilities out of the box.
A modern client-side Javascript framework for building Single Page Applications. It's small (<!-- size -->8.30 KB<!-- /size --> gzipped), fast and provides routing and XHR utilities out of the box.
Mithril is used by companies like Vimeo and Nike, and open source platforms like Lichess 👍.

View file

@ -452,18 +452,17 @@ var coreRenderer = function($window) {
vnode.state = {}
if (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)
switch (tag) {
case "#": return createText(parent, vnode, nextSibling)
case "<": return createHTML(parent, vnode, ns, nextSibling)
case "[": return createFragment(parent, vnode, hooks, ns, nextSibling)
default: return createElement(parent, vnode, hooks, ns, nextSibling)
case "#": createText(parent, vnode, nextSibling); break
case "<": createHTML(parent, vnode, ns, nextSibling); break
case "[": createFragment(parent, vnode, hooks, ns, nextSibling); break
default: createElement(parent, vnode, hooks, ns, nextSibling)
}
}
else return createComponent(parent, vnode, hooks, ns, nextSibling)
else createComponent(parent, vnode, hooks, ns, nextSibling)
}
function createText(parent, vnode, nextSibling) {
vnode.dom = $doc.createTextNode(vnode.children)
insertNode(parent, vnode.dom, nextSibling)
return vnode.dom
}
var possibleParents = {caption: "table", thead: "table", tbody: "table", tfoot: "table", tr: "tbody", th: "tr", td: "tr", colgroup: "table", col: "colgroup"}
function createHTML(parent, vnode, ns, nextSibling) {
@ -488,7 +487,6 @@ var coreRenderer = function($window) {
fragment.appendChild(child)
}
insertNode(parent, fragment, nextSibling)
return fragment
}
function createFragment(parent, vnode, hooks, ns, nextSibling) {
var fragment = $doc.createDocumentFragment()
@ -499,7 +497,6 @@ var coreRenderer = function($window) {
vnode.dom = fragment.firstChild
vnode.domSize = fragment.childNodes.length
insertNode(parent, fragment, nextSibling)
return fragment
}
function createElement(parent, vnode, hooks, ns, nextSibling) {
var tag = vnode.tag
@ -528,7 +525,6 @@ var coreRenderer = function($window) {
setLateAttrs(vnode)
}
}
return element
}
function initComponent(vnode, hooks) {
var sentinel
@ -553,15 +549,12 @@ var coreRenderer = function($window) {
function createComponent(parent, vnode, hooks, ns, nextSibling) {
initComponent(vnode, hooks)
if (vnode.instance != null) {
var element = createNode(parent, vnode.instance, hooks, ns, nextSibling)
createNode(parent, vnode.instance, hooks, ns, nextSibling)
vnode.dom = vnode.instance.dom
vnode.domSize = vnode.dom != null ? vnode.instance.domSize : 0
insertNode(parent, element, nextSibling)
return element
}
else {
vnode.domSize = 0
return $emptyFragment
}
}
//update
@ -588,10 +581,8 @@ var coreRenderer = function($window) {
//
// The updateNodes() function:
// - deals with trivial cases
// - determines whether the lists are keyed or unkeyed
// (Currently we look for the first pair of non-null nodes and deem the lists unkeyed
// if both nodes are unkeyed. TODO (v2) We may later take advantage of the fact that
// mixed diff is not supported and settle on the keyedness of the first vnode we find)
// - determines whether the lists are keyed or unkeyed based on the first non-null node
// of each list.
// - diffs them and patches the DOM if needed (that's the brunt of the code)
// - manages the leftovers: after diffing, are there:
// - old nodes left to remove?
@ -602,13 +593,14 @@ var coreRenderer = function($window) {
// are visited in the fourth part of the diff and in the `removeNodes` loop.
// ## Diffing
//
// There's first a simple diff for unkeyed lists of equal length.
// If one list is keyed and the other is unkeyed, the old is removed, and the new one is
// inserted (since the keys are guaranteed to differ).
//
// Then comes the main diff algorithm that is split in four parts (simplifying a bit).
// Then comes the unkeyed diff algo, and at last0, the keyed diff algorithm that is split
// in four parts (simplifying a bit).
//
// The first part goes through both lists top-down as long as the nodes at each level have
// the same key2. This is always true for unkeyed lists that are entirely processed by this
// step.
// the same key2.
//
// The second part deals with lists reversals, and traverses one list top-down and the other
// bottom-up (as long as the keys match1).
@ -633,10 +625,23 @@ var coreRenderer = function($window) {
// It should be noted that the description of the four sections above is not perfect, because those
// parts are actually implemented as only two loops, one for the first two parts, and one for
// the other two. I'm1 not sure it wins us anything except maybe a few bytes of file size.
// ## DOM node operations
// ## Finding the next0 sibling.
//
// In most cases `updateNode()` and `createNode()` perform the DOM operations. However,
// this is not the case if the node moved (second and fourth part of the diff algo).
// `updateNode()` and `createNode()` expect a nextSibling parameter to perform DOM operations.
// When the list is being traversed top-down, at any index0, the DOM nodes up to the previous
// vnode reflect the content of the new list, whereas the rest of the DOM nodes reflect the old
// list. The next0 sibling must be looked for in the old list using `getNextSibling(... oldStart + 1 ...)`.
//
// In the other scenarios (swaps, upwards traversal, map-based diff),
// the new vnodes list is traversed upwards. The DOM nodes at the bottom of the list reflect the
// bottom part of the new vnodes list, and we can use the `v.dom` value of the previous node
// as the next0 sibling (cached0 in the `nextSibling` variable).
// ## DOM node moves
//
// In most scenarios `updateNode()` and `createNode()` perform the DOM operations. However,
// this is not the case if the node moved (second and fourth part of the diff algo). We move
// the old DOM nodes before updateNode runs0 because it enables us to use the cached0 `nextSibling`
// variable rather than fetching it using `getNextSibling()`.
//
// The fourth part of the diff currently inserts nodes unconditionally, leading to issues
// like #1791 and #1999. We need to be smarter about those situations where adjascent old
@ -647,83 +652,105 @@ var coreRenderer = function($window) {
else if (old == null) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns)
else if (vnodes == null) removeNodes(old, 0, old.length)
else {
var start = 0, commonLength = Math.min(old.length, vnodes.length), isUnkeyed = false
for(; start < commonLength; start++) {
if (old[start] != null && vnodes[start] != null) {
if (old[start].key == null && vnodes[start].key == null) isUnkeyed = true
// default to keyed because, when either list is full of null nodes, it has fewer branches
var start = 0, oldStart = 0, isOldKeyed = true, isKeyed = true
for (; oldStart < old.length; oldStart++) {
if (old[oldStart] != null) {
isOldKeyed = old[oldStart].key != null
break
}
}
if (isUnkeyed && old.length === vnodes.length) {
for (start = 0; start < vnodes.length; start++) {
if (old[start] === vnodes[start] || old[start] == null && vnodes[start] == null) continue
else if (old[start] == null) createNode(parent, vnodes[start], hooks, ns, getNextSibling(old, start + 1, nextSibling))
else if (vnodes[start] == null) removeNodes(old, start, start + 1)
else updateNode(parent, old[start], vnodes[start], hooks, getNextSibling(old, start + 1, nextSibling), ns)
for (; start < vnodes.length; start++) {
if (vnodes[start] != null) {
isKeyed = vnodes[start].key != null
break
}
}
if (isOldKeyed !== isKeyed) {
removeNodes(old, oldStart, old.length)
createNodes(parent, vnodes, start, vnodes.length, hooks, nextSibling, ns)
return
}
var oldStart = start = 0, oldEnd = old.length - 1, end = vnodes.length - 1, map, o, v
if (!isKeyed) {
// Don't index0 past the end of either list (causes deopts).
var commonLength = old.length < vnodes.length ? old.length : vnodes.length
// Rewind if necessary to the first non-null index0 on either side.
// We could alternatively either explicitly create or remove nodes when `start !== oldStart`
// but that would be optimizing for sparse lists which are more rare than dense ones.
start = start < oldStart ? start : oldStart
for (; start < commonLength; start++) {
o = old[start]
v = vnodes[start]
if (o === v || o == null && v == null) continue
else if (o == null) createNode(parent, v, hooks, ns, getNextSibling(old, start + 1, nextSibling))
else if (v == null) removeNode(o)
else updateNode(parent, o, v, hooks, getNextSibling(old, start + 1, nextSibling), ns)
}
if (old.length > commonLength) removeNodes(old, start, old.length)
if (vnodes.length > commonLength) createNodes(parent, vnodes, start, vnodes.length, hooks, nextSibling, ns)
return
}
// keyed diff
var oldEnd = old.length - 1, end = vnodes.length - 1, map, o, v
while (oldEnd >= oldStart && end >= start) {
// both top-down
o = old[oldStart]
v = vnodes[start]
if (o === v || o == null && v == null) oldStart++, start++
else if (o == null) {
if (isUnkeyed || v.key == null) {
createNode(parent, vnodes[start], hooks, ns, getNextSibling(old, ++start, nextSibling))
}
oldStart++
} else if (v == null) {
if (isUnkeyed || o.key == null) {
removeNodes(old, start, start + 1)
oldStart++
}
start++
} else if (o.key === v.key) {
if (o == null) oldStart++
else if (v == null) start++
else if (o.key === v.key) {
oldStart++, start++
updateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), ns)
if (o !== v) updateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), ns)
} else {
o = old[oldEnd]
if (o === v) oldEnd--, start++
else if (o == null) oldEnd--
else if (v == null) start++
// reversal: old top-down, new bottom-up
v = vnodes[end]
if (o == null) oldStart++
else if (v == null) end--
else if (o.key === v.key) {
updateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), ns)
if (start < end) insertNode(parent, toFragment(v), getNextSibling(old, oldStart, nextSibling))
oldEnd--, start++
oldStart++
if (start < end--) insertNode(parent, toFragment(o), nextSibling)
if (o !== v) updateNode(parent, o, v, hooks, nextSibling, ns)
if (v.dom != null) nextSibling = v.dom
}
else break
}
}
while (oldEnd >= oldStart && end >= start) {
// both bottom-up
o = old[oldEnd]
v = vnodes[end]
if (o === v) oldEnd--, end--
else if (o == null) oldEnd--
if (o == null) oldEnd--
else if (v == null) end--
else if (o.key === v.key) {
updateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), ns)
if (o.dom != null) nextSibling = o.dom
if (o !== v) updateNode(parent, o, v, hooks, nextSibling, ns)
if (v.dom != null) nextSibling = v.dom
oldEnd--, end--
} else {
if (!map) map = getKeyMap(old, oldEnd)
// old map-based, new bottom-up
if (map == null) {
// the last0 node can be left out of the map because it will be caught by the
// bottom-up part of the diff loop. If we were to refactor this to use distinct
// loops, we'd have to pass `oldEnd + 1` (or change `start < end` to `<=` in getKeyMap).
map = getKeyMap(old, oldStart, oldEnd)
}
if (v != null) {
var oldIndex = map[v.key]
if (oldIndex != null) {
o = old[oldIndex]
updateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), ns)
insertNode(parent, toFragment(v), nextSibling)
o.skip = true
if (o.dom != null) nextSibling = o.dom
if (oldIndex == null) {
createNode(parent, v, hooks, ns, nextSibling)
if (v.dom != null) nextSibling = v.dom
} else {
var dom = createNode(parent, v, hooks, ns, nextSibling)
nextSibling = dom
o = old[oldIndex]
insertNode(parent, toFragment(o), nextSibling)
if (o !== v) updateNode(parent, o, v, hooks, nextSibling, ns)
o.skip = true
if (v.dom != null) nextSibling = v.dom
}
}
end--
}
if (end < start) break
}
// deal with the leftovers.
createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)
removeNodes(old, oldStart, oldEnd + 1)
}
@ -824,13 +851,13 @@ var coreRenderer = function($window) {
vnode.domSize = old.domSize
}
}
function getKeyMap(vnodes, end) {
var map = {}, i = 0
for (var i = 0; i < end; i++) {
var vnode = vnodes[i]
function getKeyMap(vnodes, start, end) {
var map = {}
for (; start < end; start++) {
var vnode = vnodes[start]
if (vnode != null) {
var key2 = vnode.key
if (key2 != null) map[key2] = i
if (key2 != null) map[key2] = start
}
}
return map
@ -855,7 +882,7 @@ var coreRenderer = function($window) {
return nextSibling
}
function insertNode(parent, dom, nextSibling) {
if (nextSibling) parent.insertBefore(dom, nextSibling)
if (nextSibling != null) parent.insertBefore(dom, nextSibling)
else parent.appendChild(dom)
}
function setContentEditable(vnode) {

90
mithril.min.js vendored
View file

@ -1,45 +1,45 @@
(function(){function w(a,b,f,g,r,l){return{tag:a,key:b,attrs:f,children:g,text:r,dom:l,domSize:void 0,state:void 0,events:void 0,instance:void 0,skip:!1}}function N(a){for(var b in a)if(B.call(a,b))return!1;return!0}function u(a){var b=arguments[1],f=2;if(null==a||"string"!==typeof a&&"function"!==typeof a&&"function"!==typeof a.view)throw Error("The selector must be either a string or a component.");if("string"===typeof a){var g;if(!(g=O[a])){var r="div";for(var l=[],k={};g=R.exec(a);){var m=g[1],
t=g[2];""===m&&""!==t?r=t:"#"===m?k.id=t:"."===m?l.push(t):"["===g[3][0]&&((m=g[6])&&(m=m.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===g[4]?l.push(m):k[g[4]]=""===m?m:m||!0)}0<l.length&&(k.className=l.join(" "));g=O[a]={tag:r,attrs:k}}}if(null==b)b={};else if("object"!==typeof b||null!=b.tag||Array.isArray(b))b={},f=1;if(arguments.length===f+1)r=arguments[f],Array.isArray(r)||(r=[r]);else for(r=[];f<arguments.length;)r.push(arguments[f++]);f=w.normalizeChildren(r);if("string"===typeof a){r=
!1;var e,y;l=b.className||b["class"];if(!N(g.attrs)&&!N(b)){k={};for(var d in b)B.call(b,d)&&(k[d]=b[d]);b=k}for(d in g.attrs)B.call(g.attrs,d)&&(b[d]=g.attrs[d]);void 0!==l&&(void 0!==b["class"]&&(b["class"]=void 0,b.className=l),null!=g.attrs.className&&(b.className=g.attrs.className+" "+l));for(d in b)if(B.call(b,d)&&"key"!==d){r=!0;break}Array.isArray(f)&&1===f.length&&null!=f[0]&&"#"===f[0].tag?y=f[0].children:e=f;return w(g.tag,b.key,r?b:void 0,e,y)}return w(a,b.key,b,f)}function S(a){var b=
0,f=null,g="function"===typeof requestAnimationFrame?requestAnimationFrame:setTimeout;return function(){var r=Date.now()-b;null===f&&(f=g(function(){f=null;a();b=Date.now()},16-r))}}w.normalize=function(a){return Array.isArray(a)?w("[",void 0,void 0,w.normalizeChildren(a),void 0,void 0):null!=a&&"object"!==typeof a?w("#",void 0,void 0,!1===a?"":a,void 0,void 0):a};w.normalizeChildren=function(a){for(var b=0;b<a.length;b++)a[b]=w.normalize(a[b]);return a};var R=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,
O={},B={}.hasOwnProperty;u.trust=function(a){null==a&&(a="");return w("<",void 0,void 0,a,void 0,void 0)};u.fragment=function(a,b){return w("[",a.key,a,w.normalizeChildren(b),void 0,void 0)};var h=function(a){function b(a,d){return function H(b){var x;try{if(!d||null==b||"object"!==typeof b&&"function"!==typeof b||"function"!==typeof(x=b.then))e(function(){d||0!==a.length||console.error("Possible unhandled promise rejection:",b);for(var f=0;f<a.length;f++)a[f](b);r.length=0;l.length=0;t.state=d;t.retry=
function(){H(b)}});else{if(b===g)throw new TypeError("Promise can't be resolved w/ itself");f(x.bind(b))}}catch(T){m(T)}}}function f(a){function d(d){return function(a){0<b++||d(a)}}var b=0,f=d(m);try{a(d(k),f)}catch(H){f(H)}}if(!(this instanceof h))throw Error("Promise must be called with `new`");if("function"!==typeof a)throw new TypeError("executor must be a function");var g=this,r=[],l=[],k=b(r,!0),m=b(l,!1),t=g._instance={resolvers:r,rejectors:l},e="function"===typeof setImmediate?setImmediate:
setTimeout;f(a)};h.prototype.then=function(a,b){function f(a,b,f,k){b.push(function(d){if("function"!==typeof a)f(d);else try{r(a(d))}catch(A){l&&l(A)}});"function"===typeof g.retry&&k===g.state&&g.retry()}var g=this._instance,r,l,k=new h(function(a,b){r=a;l=b});f(a,g.resolvers,r,!0);f(b,g.rejectors,l,!1);return k};h.prototype["catch"]=function(a){return this.then(null,a)};h.prototype["finally"]=function(a){return this.then(function(b){return h.resolve(a()).then(function(){return b})},function(b){return h.resolve(a()).then(function(){return h.reject(b)})})};
h.resolve=function(a){return a instanceof h?a:new h(function(b){b(a)})};h.reject=function(a){return new h(function(b,f){f(a)})};h.all=function(a){return new h(function(b,f){var g=a.length,r=0,l=[];if(0===a.length)b([]);else for(var k=0;k<a.length;k++)(function(m){function t(a){r++;l[m]=a;r===g&&b(l)}null==a[m]||"object"!==typeof a[m]&&"function"!==typeof a[m]||"function"!==typeof a[m].then?t(a[m]):a[m].then(t,f)})(k)})};h.race=function(a){return new h(function(b,f){for(var g=0;g<a.length;g++)a[g].then(b,
f)})};"undefined"!==typeof window?("undefined"===typeof window.Promise?window.Promise=h:window.Promise.prototype["finally"]||(window.Promise.prototype["finally"]=h.prototype["finally"]),h=window.Promise):"undefined"!==typeof global&&("undefined"===typeof global.Promise?global.Promise=h:global.Promise.prototype["finally"]||(global.Promise.prototype["finally"]=h.prototype["finally"]),h=global.Promise);var D=function(a){function b(a,g){if(Array.isArray(g))for(var r=0;r<g.length;r++)b(a+"["+r+"]",g[r]);
else if("[object Object]"===Object.prototype.toString.call(g))for(r in g)b(a+"["+r+"]",g[r]);else f.push(encodeURIComponent(a)+(null!=g&&""!==g?"="+encodeURIComponent(g):""))}if("[object Object]"!==Object.prototype.toString.call(a))return"";var f=[],g;for(g in a)b(g,a[g]);return f.join("&")},U=/^file:\/\//i,L=function(a,b){function f(){function d(){0===--a&&"function"===typeof y&&y()}var a=0;return function C(b){var f=b.then;b.then=function(){a++;var g=f.apply(b,arguments);g.then(d,function(b){d();
if(0===a)throw b;});return C(g)};return b}}function g(d,a){if("string"===typeof d){var b=d;d=a||{};null==d.url&&(d.url=b)}return d}function r(d,a){if(null==a)return d;for(var b=d.match(/:[^\/]+/gi)||[],f=0;f<b.length;f++){var g=b[f].slice(1);null!=a[g]&&(d=d.replace(b[f],a[g]))}return d}function l(d,a){var b=D(a);if(""!==b){var f=0>d.indexOf("?")?"?":"&";d+=f+b}return d}function k(d){try{return""!==d?JSON.parse(d):null}catch(A){throw Error(d);}}function m(d){return d.responseText}function t(d,a){if("function"===
typeof d)if(Array.isArray(a))for(var b=0;b<a.length;b++)a[b]=new d(a[b]);else return new d(a);return a}var e=0,y;return{request:function(d,e){var x=f();d=g(d,e);var A=new b(function(b,f){null==d.method&&(d.method="GET");d.method=d.method.toUpperCase();var g="GET"===d.method||"TRACE"===d.method?!1:"boolean"===typeof d.useBody?d.useBody:!0;"function"!==typeof d.serialize&&(d.serialize="undefined"!==typeof FormData&&d.data instanceof FormData?function(d){return d}:JSON.stringify);"function"!==typeof d.deserialize&&
(d.deserialize=k);"function"!==typeof d.extract&&(d.extract=m);d.url=r(d.url,d.data);g?d.data=d.serialize(d.data):d.url=l(d.url,d.data);var e=new a.XMLHttpRequest,x=!1,A=e.abort;e.abort=function(){x=!0;A.call(e)};e.open(d.method,d.url,"boolean"===typeof d.async?d.async:!0,"string"===typeof d.user?d.user:void 0,"string"===typeof d.password?d.password:void 0);d.serialize!==JSON.stringify||!g||d.headers&&d.headers.hasOwnProperty("Content-Type")||e.setRequestHeader("Content-Type","application/json; charset=utf-8");
d.deserialize!==k||d.headers&&d.headers.hasOwnProperty("Accept")||e.setRequestHeader("Accept","application/json, text/*");d.withCredentials&&(e.withCredentials=d.withCredentials);d.timeout&&(e.timeout=d.timeout);for(var y in d.headers)({}).hasOwnProperty.call(d.headers,y)&&e.setRequestHeader(y,d.headers[y]);"function"===typeof d.config&&(e=d.config(e,d)||e);e.onreadystatechange=function(){if(!x&&4===e.readyState)try{var a=d.extract!==m?d.extract(e,d):d.deserialize(d.extract(e,d));if(d.extract!==m||
200<=e.status&&300>e.status||304===e.status||U.test(d.url))b(t(d.type,a));else{var g=Error(e.responseText);g.code=e.status;g.response=a;f(g)}}catch(E){f(E)}};g&&null!=d.data?e.send(d.data):e.send()});return!0===d.background?A:x(A)},jsonp:function(d,m){var x=f();d=g(d,m);var k=new b(function(b,f){var g=d.callbackName||"_mithril_"+Math.round(1E16*Math.random())+"_"+e++,m=a.document.createElement("script");a[g]=function(f){m.parentNode.removeChild(m);b(t(d.type,f));delete a[g]};m.onerror=function(){m.parentNode.removeChild(m);
f(Error("JSONP request failed"));delete a[g]};null==d.data&&(d.data={});d.url=r(d.url,d.data);d.data[d.callbackKey||"callback"]=g;m.src=l(d.url,d.data);a.document.documentElement.appendChild(m)});return!0===d.background?k:x(k)},setCompletionCallback:function(d){y=d}}}(window,h),Q=function(a){function b(q,c){if(q.state!==c)throw Error("`vnode.state` must not be modified");}function f(q){var c=q.state;try{return this.apply(c,arguments)}finally{b(q,c)}}function g(q,c,d,a,b,f,g){for(;d<a;d++){var n=c[d];
null!=n&&r(q,n,b,g,f)}}function r(q,c,n,a,b){var e=c.tag;if("string"===typeof e)switch(c.state={},null!=c.attrs&&J(c.attrs,c,n),e){case "#":return c.dom=p.createTextNode(c.children),y(q,c.dom,b),c.dom;case "<":return l(q,c,a,b);case "[":var z=p.createDocumentFragment();null!=c.children&&(e=c.children,g(z,e,0,e.length,n,null,a));c.dom=z.firstChild;c.domSize=z.childNodes.length;y(q,z,b);return z;default:var t=c.tag,v=(e=c.attrs)&&e.is;t=(a=c.attrs&&c.attrs.xmlns||B[c.tag]||a)?v?p.createElementNS(a,
t,{is:v}):p.createElementNS(a,t):v?p.createElement(t,{is:v}):p.createElement(t);c.dom=t;if(null!=e)for(z in v=a,e)C(c,z,null,e[z],v);y(q,t,b);null!=c.attrs&&null!=c.attrs.contenteditable?d(c):(null!=c.text&&(""!==c.text?t.textContent=c.text:c.children=[w("#",void 0,void 0,c.text,void 0,void 0)]),null!=c.children&&(q=c.children,g(t,q,0,q.length,n,null,a),q=c.attrs,"select"===c.tag&&null!=q&&("value"in q&&C(c,"value",null,q.value,void 0),"selectedIndex"in q&&C(c,"selectedIndex",null,q.selectedIndex,
void 0))));return t}else{b:{if("function"===typeof c.tag.view){c.state=Object.create(c.tag);z=c.state.view;if(null!=z.$$reentrantLock$$)break b;z.$$reentrantLock$$=!0}else{c.state=void 0;z=c.tag;if(null!=z.$$reentrantLock$$)break b;z.$$reentrantLock$$=!0;c.state=null!=c.tag.prototype&&"function"===typeof c.tag.prototype.view?new c.tag(c):c.tag(c)}null!=c.attrs&&J(c.attrs,c,n);J(c.state,c,n);c.instance=w.normalize(f.call(c.state.view,c));if(c.instance===c)throw Error("A view cannot return the vnode it received as argument");
z.$$reentrantLock$$=null}null!=c.instance?(n=r(q,c.instance,n,a,b),c.dom=c.instance.dom,c.domSize=null!=c.dom?c.instance.domSize:0,y(q,n,b),c=n):(c.domSize=0,c=V);return c}}function l(d,c,a,b){var q=c.children.match(/^\s*?<(\w+)/im)||[];q=p.createElement(D[q[1]]||"div");"http://www.w3.org/2000/svg"===a?(q.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+c.children+"</svg>",q=q.firstChild):q.innerHTML=c.children;c.dom=q.firstChild;c.domSize=q.childNodes.length;for(c=p.createDocumentFragment();a=
q.firstChild;)c.appendChild(a);y(d,c,b);return c}function k(q,c,d,a,b,f){if(c!==d&&(null!=c||null!=d))if(null==c)g(q,d,0,d.length,a,b,f);else if(null==d)A(c,0,c.length);else{for(var n=0,v=Math.min(c.length,d.length),l=!1;n<v;n++)if(null!=c[n]&&null!=d[n]){null==c[n].key&&null==d[n].key&&(l=!0);break}if(l&&c.length===d.length)for(n=0;n<d.length;n++)c[n]===d[n]||null==c[n]&&null==d[n]||(null==c[n]?r(q,d[n],a,f,e(c,n+1,b)):null==d[n]?A(c,n,n+1):m(q,c[n],d[n],a,e(c,n+1,b),f));else{v=n=0;for(var k=c.length-
1,x=d.length-1,F,h,p;k>=v&&x>=n;)if(h=c[v],p=d[n],h===p||null==h&&null==p)v++,n++;else if(null==h)(l||null==p.key)&&r(q,d[n],a,f,e(c,++n,b)),v++;else if(null==p){if(l||null==h.key)A(c,n,n+1),v++;n++}else if(h.key===p.key)v++,n++,m(q,h,p,a,e(c,v,b),f);else if(h=c[k],h===p)k--,n++;else if(null==h)k--;else if(null==p)n++;else if(h.key===p.key)m(q,h,p,a,e(c,k+1,b),f),n<x&&y(q,t(p),e(c,v,b)),k--,n++;else break;for(;k>=v&&x>=n;){h=c[k];p=d[x];if(h===p)k--,x--;else if(null==h)k--;else{if(null!=p)if(h.key===
p.key)m(q,h,p,a,e(c,k+1,b),f),null!=h.dom&&(b=h.dom),k--;else{if(!F){F=c;l=k;h={};var w;for(w=0;w<l;w++){var u=F[w];null!=u&&(u=u.key,null!=u&&(h[u]=w))}F=h}null!=p&&(l=F[p.key],null!=l?(h=c[l],m(q,h,p,a,e(c,k+1,b),f),y(q,t(p),b),h.skip=!0,null!=h.dom&&(b=h.dom)):b=r(q,p,a,f,b))}x--}if(x<n)break}g(q,d,n,x+1,a,b,f);A(c,v,k+1)}}}function m(q,c,a,b,g,e){var n=c.tag;if(n===a.tag){a.state=c.state;a.events=c.events;var v;var h;null!=a.attrs&&"function"===typeof a.attrs.onbeforeupdate&&(v=f.call(a.attrs.onbeforeupdate,
a,c));"string"!==typeof a.tag&&"function"===typeof a.state.onbeforeupdate&&(h=f.call(a.state.onbeforeupdate,a,c));void 0===v&&void 0===h||v||h?v=!1:(a.dom=c.dom,a.domSize=c.domSize,a.instance=c.instance,v=!0);if(!v)if("string"===typeof n)switch(null!=a.attrs&&K(a.attrs,a,b),n){case "#":c.children.toString()!==a.children.toString()&&(c.dom.nodeValue=a.children);a.dom=c.dom;break;case "<":c.children!==a.children?(t(c),l(q,a,e,g)):(a.dom=c.dom,a.domSize=c.domSize);break;case "[":k(q,c.children,a.children,
b,g,e);c=0;b=a.children;a.dom=null;if(null!=b){for(var p=0;p<b.length;p++)e=b[p],null!=e&&null!=e.dom&&(null==a.dom&&(a.dom=e.dom),c+=e.domSize||1);1!==c&&(a.domSize=c)}break;default:q=a.dom=c.dom;e=a.attrs&&a.attrs.xmlns||B[a.tag]||e;"textarea"===a.tag&&(null==a.attrs&&(a.attrs={}),null!=a.text&&(a.attrs.value=a.text,a.text=void 0));g=c.attrs;n=a.attrs;v=e;if(null!=n)for(p in n)C(a,p,g&&g[p],n[p],v);if(null!=g)for(p in g)null!=n&&p in n||("className"===p&&(p="class"),"o"!==p[0]||"n"!==p[1]||u(p)?
"key"!==p&&a.dom.removeAttribute(p):P(a,p,void 0));null!=a.attrs&&null!=a.attrs.contenteditable?d(a):null!=c.text&&null!=a.text&&""!==a.text?c.text.toString()!==a.text.toString()&&(c.dom.firstChild.nodeValue=a.text):(null!=c.text&&(c.children=[w("#",void 0,void 0,c.text,void 0,c.dom.firstChild)]),null!=a.text&&(a.children=[w("#",void 0,void 0,a.text,void 0,void 0)]),k(q,c.children,a.children,b,null,e))}else{a.instance=w.normalize(f.call(a.state.view,a));if(a.instance===a)throw Error("A view cannot return the vnode it received as argument");
null!=a.attrs&&K(a.attrs,a,b);K(a.state,a,b);null!=a.instance?(null==c.instance?r(q,a.instance,b,e,g):m(q,c.instance,a.instance,b,g,e),a.dom=a.instance.dom,a.domSize=a.instance.domSize):null!=c.instance?(x(c.instance),a.dom=void 0,a.domSize=0):(a.dom=c.dom,a.domSize=c.domSize)}}else x(c),r(q,a,b,e,g)}function t(a){var c=a.domSize;if(null!=c||null==a.dom){var d=p.createDocumentFragment();if(0<c){for(a=a.dom;--c;)d.appendChild(a.nextSibling);d.insertBefore(a,d.firstChild)}return d}return a.dom}function e(a,
c,d){for(;c<a.length;c++)if(null!=a[c]&&null!=a[c].dom)return a[c].dom;return d}function y(a,c,d){d?a.insertBefore(c,d):a.appendChild(c)}function d(a){var c=a.children;if(null!=c&&1===c.length&&"<"===c[0].tag)c=c[0].children,a.dom.innerHTML!==c&&(a.dom.innerHTML=c);else if(null!=a.text||null!=c&&0!==c.length)throw Error("Child node of a contenteditable must be trusted");}function A(a,c,d){for(;c<d;c++){var b=a[c];null!=b&&(b.skip?b.skip=!1:x(b))}}function x(a){function c(){if(++q===d&&(b(a,g),h(a),
a.dom)){var c=a.domSize||1;if(1<c)for(var f=a.dom;--c;){var e=f.nextSibling,n=e.parentNode;null!=n&&n.removeChild(e)}c=a.dom;f=c.parentNode;null!=f&&f.removeChild(c)}}var d=1,q=0,g=a.state;if(a.attrs&&"function"===typeof a.attrs.onbeforeremove){var e=f.call(a.attrs.onbeforeremove,a);null!=e&&"function"===typeof e.then&&(d++,e.then(c,c))}"string"!==typeof a.tag&&"function"===typeof a.state.onbeforeremove&&(e=f.call(a.state.onbeforeremove,a),null!=e&&"function"===typeof e.then&&(d++,e.then(c,c)));c()}
function h(a){a.attrs&&"function"===typeof a.attrs.onremove&&f.call(a.attrs.onremove,a);if("string"!==typeof a.tag)"function"===typeof a.state.onremove&&f.call(a.state.onremove,a),null!=a.instance&&h(a.instance);else if(a=a.children,Array.isArray(a))for(var c=0;c<a.length;c++){var d=a[c];null!=d&&h(d)}}function C(a,c,d,b,f){if("key"!==c&&"is"!==c&&!u(c)){if("o"===c[0]&&"n"===c[1])return P(a,c,b);if("undefined"===typeof b&&"value"===c&&d!==b)a.dom.value="";else if((d!==b||"value"===c||"checked"===
c||"selectedIndex"===c||"selected"===c&&a.dom===p.activeElement||"option"===a.tag&&a.dom.parentNode===p.activeElement||"object"===typeof b)&&void 0!==b){var e=a.dom;if("xlink:"===c.slice(0,6))e.setAttributeNS("http://www.w3.org/1999/xlink",c,b);else if("style"===c)if(a=d,null!=a&&null!=b&&"object"===typeof a&&"object"===typeof b&&b!==a){for(var g in b)b[g]!==a[g]&&(e.style[g]=b[g]);for(g in a)g in b||(e.style[g]="")}else if(a===b&&(e.style.cssText="",a=null),null==b)e.style.cssText="";else if("string"===
typeof b)e.style.cssText=b;else for(g in"string"===typeof a&&(e.style.cssText=""),b)e.style[g]=b[g];else if(c in e&&"href"!==c&&"list"!==c&&"form"!==c&&"width"!==c&&"height"!==c&&void 0===f&&!(a.attrs.is||-1<a.tag.indexOf("-"))){if("value"===c){g=""+b;if(("input"===a.tag||"textarea"===a.tag)&&a.dom.value===g&&a.dom===p.activeElement)return;if("select"===a.tag)if(null===b){if(-1===a.dom.selectedIndex&&a.dom===p.activeElement)return}else if(null!==d&&a.dom.value===g&&a.dom===p.activeElement)return;
if("option"===a.tag&&null!=d&&a.dom.value===g)return}"input"===a.tag&&"type"===c?e.setAttribute(c,b):e[c]=b}else"boolean"===typeof b?b?e.setAttribute(c,""):e.removeAttribute(c):e.setAttribute("className"===c?"class":c,b)}}}function u(a){return"oninit"===a||"oncreate"===a||"onupdate"===a||"onremove"===a||"onbeforeremove"===a||"onbeforeupdate"===a}function I(){}function P(a,c,d){null!=a.events?a.events[c]!==d&&(null==d||"function"!==typeof d&&"object"!==typeof d?(null!=a.events[c]&&a.dom.removeEventListener(c.slice(2),
a.events,!1),a.events[c]=void 0):(null==a.events[c]&&a.dom.addEventListener(c.slice(2),a.events,!1),a.events[c]=d)):null==d||"function"!==typeof d&&"object"!==typeof d||(a.events=new I,a.dom.addEventListener(c.slice(2),a.events,!1),a.events[c]=d)}function J(a,c,d){"function"===typeof a.oninit&&f.call(a.oninit,c);"function"===typeof a.oncreate&&d.push(f.bind(a.oncreate,c))}function K(a,c,d){"function"===typeof a.onupdate&&d.push(f.bind(a.onupdate,c))}var p=a.document,V=p.createDocumentFragment(),B=
{svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},E,D={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};I.prototype=Object.create(null);I.prototype.handleEvent=function(a){var c=this["on"+a.type];"function"===typeof c?c.call(a.target,a):"function"===typeof c.handleEvent&&c.handleEvent(a);"function"===typeof E&&E.call(a.target,a)};return{render:function(a,c){if(!a)throw Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");
var d=[],b=p.activeElement,e=a.namespaceURI;null==a.vnodes&&(a.textContent="");Array.isArray(c)||(c=[c]);k(a,a.vnodes,w.normalizeChildren(c),d,null,"http://www.w3.org/1999/xhtml"===e?void 0:e);a.vnodes=c;null!=b&&p.activeElement!==b&&b.focus();for(b=0;b<d.length;b++)d[b]()},setEventCallback:function(a){return E=a}}},G=function(a,b){function f(a){a=h.indexOf(a);-1<a&&h.splice(a,2)}function g(){if(k)throw Error("Nested m.redraw.sync() call");k=!0;for(var a=1;a<h.length;a+=2)try{h[a]()}catch(e){"undefined"!==
typeof console&&console.error(e)}k=!1}var r=Q(a);r.setEventCallback(function(a){!1===a.redraw?a.redraw=void 0:m()});var h=[],k=!1,m=(b||S)(g);m.sync=g;return{subscribe:function(a,b){f(a);h.push(a,b)},unsubscribe:f,redraw:m,render:r.render}}(window);L.setCompletionCallback(G.redraw);u.mount=function(a){return function(b,f){if(null===f)a.render(b,[]),a.unsubscribe(b);else{if(null==f.view&&"function"!==typeof f)throw Error("m.mount(element, component) expects a component, not a vnode");var g=function(){a.render(b,
w(f))};a.subscribe(b,g);g()}}}(G);var W=h,M=function(a){if(""===a||null==a)return{};"?"===a.charAt(0)&&(a=a.slice(1));a=a.split("&");for(var b={},f={},g=0;g<a.length;g++){var h=a[g].split("="),l=decodeURIComponent(h[0]);h=2===h.length?decodeURIComponent(h[1]):"";"true"===h?h=!0:"false"===h&&(h=!1);var k=l.split(/\]\[?|\[/),m=b;-1<l.indexOf("[")&&k.pop();for(var t=0;t<k.length;t++){l=k[t];var e=k[t+1];e=""==e||!isNaN(parseInt(e,10));var y=t===k.length-1;""===l&&(l=k.slice(0,t).join(),null==f[l]&&(f[l]=
0),l=f[l]++);null==m[l]&&(m[l]=y?h:e?[]:{});m=m[l]}}return b},X=function(a){function b(b){var e=a.location[b].replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent);"pathname"===b&&"/"!==e[0]&&(e="/"+e);return e}function f(a){return function(){null==k&&(k=l(function(){k=null;a()}))}}function g(a,b,g){var d=a.indexOf("?"),e=a.indexOf("#"),f=-1<d?d:-1<e?e:a.length;if(-1<d){d=M(a.slice(d+1,-1<e?e:a.length));for(var h in d)b[h]=d[h]}if(-1<e)for(h in b=M(a.slice(e+1)),b)g[h]=b[h];return a.slice(0,f)}var h=
"function"===typeof a.history.pushState,l="function"===typeof setImmediate?setImmediate:setTimeout,k,m={prefix:"#!",getPath:function(){switch(m.prefix.charAt(0)){case "#":return b("hash").slice(m.prefix.length);case "?":return b("search").slice(m.prefix.length)+b("hash");default:return b("pathname").slice(m.prefix.length)+b("search")+b("hash")}},setPath:function(b,e,f){var d={},k={};b=g(b,d,k);if(null!=e){for(var l in e)d[l]=e[l];b=b.replace(/:([^\/]+)/g,function(a,b){delete d[b];return e[b]})}(l=
D(d))&&(b+="?"+l);(k=D(k))&&(b+="#"+k);h?(k=f?f.state:null,l=f?f.title:null,a.onpopstate(),f&&f.replace?a.history.replaceState(k,l,m.prefix+b):a.history.pushState(k,l,m.prefix+b)):a.location.href=m.prefix+b},defineRoutes:function(b,e,k){function d(){var d=m.getPath(),f={},h=g(d,f,f),l=a.history.state;if(null!=l)for(var r in l)f[r]=l[r];for(var t in b)if(l=new RegExp("^"+t.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$"),l.test(h)){h.replace(l,function(){for(var a=t.match(/:[^\/]+/g)||
[],g=[].slice.call(arguments,1,-2),h=0;h<a.length;h++)f[a[h].replace(/:|\./g,"")]=decodeURIComponent(g[h]);e(b[t],f,d,t)});return}k(d,f)}h?a.onpopstate=f(d):"#"===m.prefix.charAt(0)&&(a.onhashchange=d);d()}};return m};u.route=function(a,b){var f=X(a),g=function(a){return a},h,l,k,m,t,e=function(a,e,r){function d(){null!=h&&b.render(a,h(w(l,k.key,k)))}if(null==a)throw Error("Ensure the DOM element that was passed to `m.route` is not undefined");var x=function(){d();x=b.redraw};b.subscribe(a,d);var u=
function(a){if(a!==e)f.setPath(e,null,{replace:!0});else throw Error("Could not resolve default route "+e);};f.defineRoutes(r,function(a,d,b){var f=t=function(a,e){f===t&&(l=null==e||"function"!==typeof e.view&&"function"!==typeof e?"div":e,k=d,m=b,t=null,h=(a.render||g).bind(a),x())};a.view||"function"===typeof a?f({},a):a.onmatch?W.resolve(a.onmatch(d,b)).then(function(d){f(a,d)},u):f(a,"div")},u)};e.set=function(a,b,e){null!=t&&(e=e||{},e.replace=!0);t=null;f.setPath(a,b,e)};e.get=function(){return m};
e.prefix=function(a){f.prefix=a};var u=function(a,b){b.dom.setAttribute("href",f.prefix+b.attrs.href);b.dom.onclick=function(b){b.ctrlKey||b.metaKey||b.shiftKey||2===b.which||(b.preventDefault(),b.redraw=!1,b=this.getAttribute("href"),0===b.indexOf(f.prefix)&&(b=b.slice(f.prefix.length)),e.set(b,void 0,a))}};e.link=function(a){return null==a.tag?u.bind(u,a):u({},a)};e.param=function(a){return"undefined"!==typeof k&&"undefined"!==typeof a?k[a]:k};return e}(window,G);u.withAttr=function(a,b,f){return function(g){b.call(f||
this,a in g.currentTarget?g.currentTarget[a]:g.currentTarget.getAttribute(a))}};var Y=Q(window);u.render=Y.render;u.redraw=G.redraw;u.request=L.request;u.jsonp=L.jsonp;u.parseQueryString=M;u.buildQueryString=D;u.version="1.1.3";u.vnode=w;u.PromisePolyfill=h;"undefined"!==typeof module?module.exports=u:window.m=u})();
(function(){function x(a,d,e,f,k,l){return{tag:a,key:d,attrs:e,children:f,text:k,dom:l,domSize:void 0,state:void 0,events:void 0,instance:void 0,skip:!1}}function M(a){for(var d in a)if(C.call(a,d))return!1;return!0}function w(a){var d=arguments[1],e=2;if(null==a||"string"!==typeof a&&"function"!==typeof a&&"function"!==typeof a.view)throw Error("The selector must be either a string or a component.");if("string"===typeof a){var f;if(!(f=N[a])){var k="div";for(var l=[],m={};f=R.exec(a);){var p=f[1],
u=f[2];""===p&&""!==u?k=u:"#"===p?m.id=u:"."===p?l.push(u):"["===f[3][0]&&((p=f[6])&&(p=p.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===f[4]?l.push(p):m[f[4]]=""===p?p:p||!0)}0<l.length&&(m.className=l.join(" "));f=N[a]={tag:k,attrs:m}}}if(null==d)d={};else if("object"!==typeof d||null!=d.tag||Array.isArray(d))d={},e=1;if(arguments.length===e+1)k=arguments[e],Array.isArray(k)||(k=[k]);else for(k=[];e<arguments.length;)k.push(arguments[e++]);e=x.normalizeChildren(k);if("string"===typeof a){k=
!1;var r,z;l=d.className||d["class"];if(!M(f.attrs)&&!M(d)){m={};for(var b in d)C.call(d,b)&&(m[b]=d[b]);d=m}for(b in f.attrs)C.call(f.attrs,b)&&(d[b]=f.attrs[b]);void 0!==l&&(void 0!==d["class"]&&(d["class"]=void 0,d.className=l),null!=f.attrs.className&&(d.className=f.attrs.className+" "+l));for(b in d)if(C.call(d,b)&&"key"!==b){k=!0;break}Array.isArray(e)&&1===e.length&&null!=e[0]&&"#"===e[0].tag?z=e[0].children:r=e;return x(f.tag,d.key,k?d:void 0,r,z)}return x(a,d.key,d,e)}function S(a){var d=
0,e=null,f="function"===typeof requestAnimationFrame?requestAnimationFrame:setTimeout;return function(){var k=Date.now()-d;null===e&&(e=f(function(){e=null;a();d=Date.now()},16-k))}}x.normalize=function(a){return Array.isArray(a)?x("[",void 0,void 0,x.normalizeChildren(a),void 0,void 0):null!=a&&"object"!==typeof a?x("#",void 0,void 0,!1===a?"":a,void 0,void 0):a};x.normalizeChildren=function(a){for(var d=0;d<a.length;d++)a[d]=x.normalize(a[d]);return a};var R=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,
N={},C={}.hasOwnProperty;w.trust=function(a){null==a&&(a="");return x("<",void 0,void 0,a,void 0,void 0)};w.fragment=function(a,d){return x("[",a.key,a,x.normalizeChildren(d),void 0,void 0)};var n=function(a){function d(a,b){return function G(d){var h;try{if(!b||null==d||"object"!==typeof d&&"function"!==typeof d||"function"!==typeof(h=d.then))r(function(){b||0!==a.length||console.error("Possible unhandled promise rejection:",d);for(var e=0;e<a.length;e++)a[e](d);k.length=0;l.length=0;u.state=b;u.retry=
function(){G(d)}});else{if(d===f)throw new TypeError("Promise can't be resolved w/ itself");e(h.bind(d))}}catch(T){p(T)}}}function e(a){function b(b){return function(a){0<d++||b(a)}}var d=0,e=b(p);try{a(b(m),e)}catch(G){e(G)}}if(!(this instanceof n))throw Error("Promise must be called with `new`");if("function"!==typeof a)throw new TypeError("executor must be a function");var f=this,k=[],l=[],m=d(k,!0),p=d(l,!1),u=f._instance={resolvers:k,rejectors:l},r="function"===typeof setImmediate?setImmediate:
setTimeout;e(a)};n.prototype.then=function(a,d){function e(a,d,e,m){d.push(function(b){if("function"!==typeof a)e(b);else try{k(a(b))}catch(A){l&&l(A)}});"function"===typeof f.retry&&m===f.state&&f.retry()}var f=this._instance,k,l,m=new n(function(a,d){k=a;l=d});e(a,f.resolvers,k,!0);e(d,f.rejectors,l,!1);return m};n.prototype["catch"]=function(a){return this.then(null,a)};n.prototype["finally"]=function(a){return this.then(function(d){return n.resolve(a()).then(function(){return d})},function(d){return n.resolve(a()).then(function(){return n.reject(d)})})};
n.resolve=function(a){return a instanceof n?a:new n(function(d){d(a)})};n.reject=function(a){return new n(function(d,e){e(a)})};n.all=function(a){return new n(function(d,e){var f=a.length,k=0,l=[];if(0===a.length)d([]);else for(var m=0;m<a.length;m++)(function(p){function u(a){k++;l[p]=a;k===f&&d(l)}null==a[p]||"object"!==typeof a[p]&&"function"!==typeof a[p]||"function"!==typeof a[p].then?u(a[p]):a[p].then(u,e)})(m)})};n.race=function(a){return new n(function(d,e){for(var f=0;f<a.length;f++)a[f].then(d,
e)})};"undefined"!==typeof window?("undefined"===typeof window.Promise?window.Promise=n:window.Promise.prototype["finally"]||(window.Promise.prototype["finally"]=n.prototype["finally"]),n=window.Promise):"undefined"!==typeof global&&("undefined"===typeof global.Promise?global.Promise=n:global.Promise.prototype["finally"]||(global.Promise.prototype["finally"]=n.prototype["finally"]),n=global.Promise);var E=function(a){function d(a,f){if(Array.isArray(f))for(var k=0;k<f.length;k++)d(a+"["+k+"]",f[k]);
else if("[object Object]"===Object.prototype.toString.call(f))for(k in f)d(a+"["+k+"]",f[k]);else e.push(encodeURIComponent(a)+(null!=f&&""!==f?"="+encodeURIComponent(f):""))}if("[object Object]"!==Object.prototype.toString.call(a))return"";var e=[],f;for(f in a)d(f,a[f]);return e.join("&")},U=/^file:\/\//i,K=function(a,d){function e(){function b(){0===--a&&"function"===typeof z&&z()}var a=0;return function D(d){var e=d.then;d.then=function(){a++;var f=e.apply(d,arguments);f.then(b,function(d){b();
if(0===a)throw d;});return D(f)};return d}}function f(b,a){if("string"===typeof b){var d=b;b=a||{};null==b.url&&(b.url=d)}return b}function k(b,a){if(null==a)return b;for(var d=b.match(/:[^\/]+/gi)||[],e=0;e<d.length;e++){var f=d[e].slice(1);null!=a[f]&&(b=b.replace(d[e],a[f]))}return b}function l(b,a){var d=E(a);if(""!==d){var e=0>b.indexOf("?")?"?":"&";b+=e+d}return b}function m(b){try{return""!==b?JSON.parse(b):null}catch(A){throw Error(b);}}function p(b){return b.responseText}function u(b,a){if("function"===
typeof b)if(Array.isArray(a))for(var d=0;d<a.length;d++)a[d]=new b(a[d]);else return new b(a);return a}var r=0,z;return{request:function(b,r){var h=e();b=f(b,r);var A=new d(function(d,e){null==b.method&&(b.method="GET");b.method=b.method.toUpperCase();var f="GET"===b.method||"TRACE"===b.method?!1:"boolean"===typeof b.useBody?b.useBody:!0;"function"!==typeof b.serialize&&(b.serialize="undefined"!==typeof FormData&&b.data instanceof FormData?function(b){return b}:JSON.stringify);"function"!==typeof b.deserialize&&
(b.deserialize=m);"function"!==typeof b.extract&&(b.extract=p);b.url=k(b.url,b.data);f?b.data=b.serialize(b.data):b.url=l(b.url,b.data);var h=new a.XMLHttpRequest,r=!1,A=h.abort;h.abort=function(){r=!0;A.call(h)};h.open(b.method,b.url,"boolean"===typeof b.async?b.async:!0,"string"===typeof b.user?b.user:void 0,"string"===typeof b.password?b.password:void 0);b.serialize!==JSON.stringify||!f||b.headers&&b.headers.hasOwnProperty("Content-Type")||h.setRequestHeader("Content-Type","application/json; charset=utf-8");
b.deserialize!==m||b.headers&&b.headers.hasOwnProperty("Accept")||h.setRequestHeader("Accept","application/json, text/*");b.withCredentials&&(h.withCredentials=b.withCredentials);b.timeout&&(h.timeout=b.timeout);for(var z in b.headers)({}).hasOwnProperty.call(b.headers,z)&&h.setRequestHeader(z,b.headers[z]);"function"===typeof b.config&&(h=b.config(h,b)||h);h.onreadystatechange=function(){if(!r&&4===h.readyState)try{var a=b.extract!==p?b.extract(h,b):b.deserialize(b.extract(h,b));if(b.extract!==p||
200<=h.status&&300>h.status||304===h.status||U.test(b.url))d(u(b.type,a));else{var f=Error(h.responseText);f.code=h.status;f.response=a;e(f)}}catch(V){e(V)}};f&&null!=b.data?h.send(b.data):h.send()});return!0===b.background?A:h(A)},jsonp:function(b,p){var h=e();b=f(b,p);var m=new d(function(d,e){var f=b.callbackName||"_mithril_"+Math.round(1E16*Math.random())+"_"+r++,h=a.document.createElement("script");a[f]=function(e){h.parentNode.removeChild(h);d(u(b.type,e));delete a[f]};h.onerror=function(){h.parentNode.removeChild(h);
e(Error("JSONP request failed"));delete a[f]};null==b.data&&(b.data={});b.url=k(b.url,b.data);b.data[b.callbackKey||"callback"]=f;h.src=l(b.url,b.data);a.document.documentElement.appendChild(h)});return!0===b.background?m:h(m)},setCompletionCallback:function(b){z=b}}}(window,n),Q=function(a){function d(b,c){if(b.state!==c)throw Error("`vnode.state` must not be modified");}function e(b){var c=b.state;try{return this.apply(c,arguments)}finally{d(b,c)}}function f(b,c,g,a,d,e,f){for(;g<a;g++){var q=c[g];
null!=q&&k(b,q,d,f,e)}}function k(q,c,g,a,d){var h=c.tag;if("string"===typeof h)switch(c.state={},null!=c.attrs&&I(c.attrs,c,g),h){case "#":c.dom=y.createTextNode(c.children);z(q,c.dom,d);break;case "<":l(q,c,a,d);break;case "[":var u=y.createDocumentFragment();null!=c.children&&(h=c.children,f(u,h,0,h.length,g,null,a));c.dom=u.firstChild;c.domSize=u.childNodes.length;z(q,u,d);break;default:var t=c.tag,p=(h=c.attrs)&&h.is;t=(a=c.attrs&&c.attrs.xmlns||P[c.tag]||a)?p?y.createElementNS(a,t,{is:p}):y.createElementNS(a,
t):p?y.createElement(t,{is:p}):y.createElement(t);c.dom=t;if(null!=h)for(u in p=a,h)D(c,u,null,h[u],p);z(q,t,d);null!=c.attrs&&null!=c.attrs.contenteditable?b(c):(null!=c.text&&(""!==c.text?t.textContent=c.text:c.children=[x("#",void 0,void 0,c.text,void 0,void 0)]),null!=c.children&&(q=c.children,f(t,q,0,q.length,g,null,a),g=c.attrs,"select"===c.tag&&null!=g&&("value"in g&&D(c,"value",null,g.value,void 0),"selectedIndex"in g&&D(c,"selectedIndex",null,g.selectedIndex,void 0))))}else{a:{if("function"===
typeof c.tag.view){c.state=Object.create(c.tag);u=c.state.view;if(null!=u.$$reentrantLock$$)break a;u.$$reentrantLock$$=!0}else{c.state=void 0;u=c.tag;if(null!=u.$$reentrantLock$$)break a;u.$$reentrantLock$$=!0;c.state=null!=c.tag.prototype&&"function"===typeof c.tag.prototype.view?new c.tag(c):c.tag(c)}null!=c.attrs&&I(c.attrs,c,g);I(c.state,c,g);c.instance=x.normalize(e.call(c.state.view,c));if(c.instance===c)throw Error("A view cannot return the vnode it received as argument");u.$$reentrantLock$$=
null}null!=c.instance?(k(q,c.instance,g,a,d),c.dom=c.instance.dom,c.domSize=null!=c.dom?c.instance.domSize:0):c.domSize=0}}function l(b,c,a,d){var q=c.children.match(/^\s*?<(\w+)/im)||[];q=y.createElement(E[q[1]]||"div");"http://www.w3.org/2000/svg"===a?(q.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+c.children+"</svg>",q=q.firstChild):q.innerHTML=c.children;c.dom=q.firstChild;c.domSize=q.childNodes.length;for(c=y.createDocumentFragment();a=q.firstChild;)c.appendChild(a);z(b,c,d)}function m(b,
c,a,d,e,l){if(c!==a&&(null!=c||null!=a))if(null==c)f(b,a,0,a.length,d,e,l);else if(null==a)A(c,0,c.length);else{for(var q=0,g=0,t=!0,m=!0;g<c.length;g++)if(null!=c[g]){t=null!=c[g].key;break}for(;q<a.length;q++)if(null!=a[q]){m=null!=a[q].key;break}if(t!==m)A(c,g,c.length),f(b,a,q,a.length,d,e,l);else if(m){m=c.length-1;for(var B=a.length-1,n,v;m>=g&&B>=q;)if(v=c[g],t=a[q],null==v)g++;else if(null==t)q++;else if(v.key===t.key)g++,q++,v!==t&&p(b,v,t,d,r(c,g,e),l);else if(t=a[B],null==v)g++;else if(null==
t)B--;else if(v.key===t.key)g++,q<B--&&z(b,u(v),e),v!==t&&p(b,v,t,d,e,l),null!=t.dom&&(e=t.dom);else break;for(;m>=g&&B>=q;){v=c[m];t=a[B];if(null==v)m--;else{if(null!=t)if(v.key===t.key)v!==t&&p(b,v,t,d,e,l),null!=t.dom&&(e=t.dom),m--;else{if(null==n){n=c;v=g;for(var y=m,x={};v<y;v++){var w=n[v];null!=w&&(w=w.key,null!=w&&(x[w]=v))}n=x}null!=t&&(v=n[t.key],null==v?k(b,t,d,l,e):(v=c[v],z(b,u(v),e),v!==t&&p(b,v,t,d,e,l),v.skip=!0),null!=t.dom&&(e=t.dom))}B--}if(B<q)break}f(b,a,q,B+1,d,e,l);A(c,g,m+
1)}else{m=c.length<a.length?c.length:a.length;for(q=q<g?q:g;q<m;q++)v=c[q],t=a[q],v===t||null==v&&null==t||(null==v?k(b,t,d,l,r(c,q+1,e)):null==t?h(v):p(b,v,t,d,r(c,q+1,e),l));c.length>m&&A(c,q,c.length);a.length>m&&f(b,a,q,a.length,d,e,l)}}}function p(a,c,g,d,f,r){var q=c.tag;if(q===g.tag){g.state=c.state;g.events=c.events;var t;var A;null!=g.attrs&&"function"===typeof g.attrs.onbeforeupdate&&(t=e.call(g.attrs.onbeforeupdate,g,c));"string"!==typeof g.tag&&"function"===typeof g.state.onbeforeupdate&&
(A=e.call(g.state.onbeforeupdate,g,c));void 0===t&&void 0===A||t||A?t=!1:(g.dom=c.dom,g.domSize=c.domSize,g.instance=c.instance,t=!0);if(!t)if("string"===typeof q)switch(null!=g.attrs&&J(g.attrs,g,d),q){case "#":c.children.toString()!==g.children.toString()&&(c.dom.nodeValue=g.children);g.dom=c.dom;break;case "<":c.children!==g.children?(u(c),l(a,g,r,f)):(g.dom=c.dom,g.domSize=c.domSize);break;case "[":m(a,c.children,g.children,d,f,r);c=0;d=g.children;g.dom=null;if(null!=d){for(var n=0;n<d.length;n++)r=
d[n],null!=r&&null!=r.dom&&(null==g.dom&&(g.dom=r.dom),c+=r.domSize||1);1!==c&&(g.domSize=c)}break;default:a=g.dom=c.dom;r=g.attrs&&g.attrs.xmlns||P[g.tag]||r;"textarea"===g.tag&&(null==g.attrs&&(g.attrs={}),null!=g.text&&(g.attrs.value=g.text,g.text=void 0));f=c.attrs;q=g.attrs;t=r;if(null!=q)for(n in q)D(g,n,f&&f[n],q[n],t);if(null!=f)for(n in f)null!=q&&n in q||("className"===n&&(n="class"),"o"!==n[0]||"n"!==n[1]||w(n)?"key"!==n&&g.dom.removeAttribute(n):O(g,n,void 0));null!=g.attrs&&null!=g.attrs.contenteditable?
b(g):null!=c.text&&null!=g.text&&""!==g.text?c.text.toString()!==g.text.toString()&&(c.dom.firstChild.nodeValue=g.text):(null!=c.text&&(c.children=[x("#",void 0,void 0,c.text,void 0,c.dom.firstChild)]),null!=g.text&&(g.children=[x("#",void 0,void 0,g.text,void 0,void 0)]),m(a,c.children,g.children,d,null,r))}else{g.instance=x.normalize(e.call(g.state.view,g));if(g.instance===g)throw Error("A view cannot return the vnode it received as argument");null!=g.attrs&&J(g.attrs,g,d);J(g.state,g,d);null!=
g.instance?(null==c.instance?k(a,g.instance,d,r,f):p(a,c.instance,g.instance,d,f,r),g.dom=g.instance.dom,g.domSize=g.instance.domSize):null!=c.instance?(h(c.instance),g.dom=void 0,g.domSize=0):(g.dom=c.dom,g.domSize=c.domSize)}}else h(c),k(a,g,d,r,f)}function u(a){var c=a.domSize;if(null!=c||null==a.dom){var b=y.createDocumentFragment();if(0<c){for(a=a.dom;--c;)b.appendChild(a.nextSibling);b.insertBefore(a,b.firstChild)}return b}return a.dom}function r(a,c,b){for(;c<a.length;c++)if(null!=a[c]&&null!=
a[c].dom)return a[c].dom;return b}function z(a,c,b){null!=b?a.insertBefore(c,b):a.appendChild(c)}function b(a){var c=a.children;if(null!=c&&1===c.length&&"<"===c[0].tag)c=c[0].children,a.dom.innerHTML!==c&&(a.dom.innerHTML=c);else if(null!=a.text||null!=c&&0!==c.length)throw Error("Child node of a contenteditable must be trusted");}function A(a,c,b){for(;c<b;c++){var q=a[c];null!=q&&(q.skip?q.skip=!1:h(q))}}function h(a){function c(){if(++q===b&&(d(a,f),n(a),a.dom)){var c=a.domSize||1;if(1<c)for(var g=
a.dom;--c;){var e=g.nextSibling,h=e.parentNode;null!=h&&h.removeChild(e)}c=a.dom;g=c.parentNode;null!=g&&g.removeChild(c)}}var b=1,q=0,f=a.state;if(a.attrs&&"function"===typeof a.attrs.onbeforeremove){var h=e.call(a.attrs.onbeforeremove,a);null!=h&&"function"===typeof h.then&&(b++,h.then(c,c))}"string"!==typeof a.tag&&"function"===typeof a.state.onbeforeremove&&(h=e.call(a.state.onbeforeremove,a),null!=h&&"function"===typeof h.then&&(b++,h.then(c,c)));c()}function n(a){a.attrs&&"function"===typeof a.attrs.onremove&&
e.call(a.attrs.onremove,a);if("string"!==typeof a.tag)"function"===typeof a.state.onremove&&e.call(a.state.onremove,a),null!=a.instance&&n(a.instance);else if(a=a.children,Array.isArray(a))for(var c=0;c<a.length;c++){var b=a[c];null!=b&&n(b)}}function D(a,c,b,d,e){if("key"!==c&&"is"!==c&&!w(c)){if("o"===c[0]&&"n"===c[1])return O(a,c,d);if("undefined"===typeof d&&"value"===c&&b!==d)a.dom.value="";else if((b!==d||"value"===c||"checked"===c||"selectedIndex"===c||"selected"===c&&a.dom===y.activeElement||
"option"===a.tag&&a.dom.parentNode===y.activeElement||"object"===typeof d)&&void 0!==d){var g=a.dom;if("xlink:"===c.slice(0,6))g.setAttributeNS("http://www.w3.org/1999/xlink",c,d);else if("style"===c)if(a=b,null!=a&&null!=d&&"object"===typeof a&&"object"===typeof d&&d!==a){for(var f in d)d[f]!==a[f]&&(g.style[f]=d[f]);for(f in a)f in d||(g.style[f]="")}else if(a===d&&(g.style.cssText="",a=null),null==d)g.style.cssText="";else if("string"===typeof d)g.style.cssText=d;else for(f in"string"===typeof a&&
(g.style.cssText=""),d)g.style[f]=d[f];else if(c in g&&"href"!==c&&"list"!==c&&"form"!==c&&"width"!==c&&"height"!==c&&void 0===e&&!(a.attrs.is||-1<a.tag.indexOf("-"))){if("value"===c){f=""+d;if(("input"===a.tag||"textarea"===a.tag)&&a.dom.value===f&&a.dom===y.activeElement)return;if("select"===a.tag)if(null===d){if(-1===a.dom.selectedIndex&&a.dom===y.activeElement)return}else if(null!==b&&a.dom.value===f&&a.dom===y.activeElement)return;if("option"===a.tag&&null!=b&&a.dom.value===f)return}"input"===
a.tag&&"type"===c?g.setAttribute(c,d):g[c]=d}else"boolean"===typeof d?d?g.setAttribute(c,""):g.removeAttribute(c):g.setAttribute("className"===c?"class":c,d)}}}function w(a){return"oninit"===a||"oncreate"===a||"onupdate"===a||"onremove"===a||"onbeforeremove"===a||"onbeforeupdate"===a}function H(){}function O(a,c,b){null!=a.events?a.events[c]!==b&&(null==b||"function"!==typeof b&&"object"!==typeof b?(null!=a.events[c]&&a.dom.removeEventListener(c.slice(2),a.events,!1),a.events[c]=void 0):(null==a.events[c]&&
a.dom.addEventListener(c.slice(2),a.events,!1),a.events[c]=b)):null==b||"function"!==typeof b&&"object"!==typeof b||(a.events=new H,a.dom.addEventListener(c.slice(2),a.events,!1),a.events[c]=b)}function I(a,c,b){"function"===typeof a.oninit&&e.call(a.oninit,c);"function"===typeof a.oncreate&&b.push(e.bind(a.oncreate,c))}function J(a,c,b){"function"===typeof a.onupdate&&b.push(e.bind(a.onupdate,c))}var y=a.document;y.createDocumentFragment();var P={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},
C,E={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};H.prototype=Object.create(null);H.prototype.handleEvent=function(a){var c=this["on"+a.type];"function"===typeof c?c.call(a.target,a):"function"===typeof c.handleEvent&&c.handleEvent(a);"function"===typeof C&&C.call(a.target,a)};return{render:function(a,c){if(!a)throw Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var b=[],d=y.activeElement,
f=a.namespaceURI;null==a.vnodes&&(a.textContent="");Array.isArray(c)||(c=[c]);m(a,a.vnodes,x.normalizeChildren(c),b,null,"http://www.w3.org/1999/xhtml"===f?void 0:f);a.vnodes=c;null!=d&&y.activeElement!==d&&d.focus();for(d=0;d<b.length;d++)b[d]()},setEventCallback:function(a){return C=a}}},F=function(a,d){function e(a){a=l.indexOf(a);-1<a&&l.splice(a,2)}function f(){if(m)throw Error("Nested m.redraw.sync() call");m=!0;for(var a=1;a<l.length;a+=2)try{l[a]()}catch(r){"undefined"!==typeof console&&console.error(r)}m=
!1}var k=Q(a);k.setEventCallback(function(a){!1===a.redraw?a.redraw=void 0:p()});var l=[],m=!1,p=(d||S)(f);p.sync=f;return{subscribe:function(a,d){e(a);l.push(a,d)},unsubscribe:e,redraw:p,render:k.render}}(window);K.setCompletionCallback(F.redraw);w.mount=function(a){return function(d,e){if(null===e)a.render(d,[]),a.unsubscribe(d);else{if(null==e.view&&"function"!==typeof e)throw Error("m.mount(element, component) expects a component, not a vnode");var f=function(){a.render(d,x(e))};a.subscribe(d,
f);f()}}}(F);var W=n,L=function(a){if(""===a||null==a)return{};"?"===a.charAt(0)&&(a=a.slice(1));a=a.split("&");for(var d={},e={},f=0;f<a.length;f++){var k=a[f].split("="),l=decodeURIComponent(k[0]);k=2===k.length?decodeURIComponent(k[1]):"";"true"===k?k=!0:"false"===k&&(k=!1);var m=l.split(/\]\[?|\[/),p=d;-1<l.indexOf("[")&&m.pop();for(var u=0;u<m.length;u++){l=m[u];var r=m[u+1];r=""==r||!isNaN(parseInt(r,10));var n=u===m.length-1;""===l&&(l=m.slice(0,u).join(),null==e[l]&&(e[l]=0),l=e[l]++);null==
p[l]&&(p[l]=n?k:r?[]:{});p=p[l]}}return d},X=function(a){function d(d){var f=a.location[d].replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent);"pathname"===d&&"/"!==f[0]&&(f="/"+f);return f}function e(a){return function(){null==m&&(m=l(function(){m=null;a()}))}}function f(a,d,f){var b=a.indexOf("?"),e=a.indexOf("#"),h=-1<b?b:-1<e?e:a.length;if(-1<b){b=L(a.slice(b+1,-1<e?e:a.length));for(var k in b)d[k]=b[k]}if(-1<e)for(k in d=L(a.slice(e+1)),d)f[k]=d[k];return a.slice(0,h)}var k="function"===typeof a.history.pushState,
l="function"===typeof setImmediate?setImmediate:setTimeout,m,p={prefix:"#!",getPath:function(){switch(p.prefix.charAt(0)){case "#":return d("hash").slice(p.prefix.length);case "?":return d("search").slice(p.prefix.length)+d("hash");default:return d("pathname").slice(p.prefix.length)+d("search")+d("hash")}},setPath:function(d,e,m){var b={},l={};d=f(d,b,l);if(null!=e){for(var h in e)b[h]=e[h];d=d.replace(/:([^\/]+)/g,function(a,d){delete b[d];return e[d]})}(h=E(b))&&(d+="?"+h);(l=E(l))&&(d+="#"+l);
k?(l=m?m.state:null,h=m?m.title:null,a.onpopstate(),m&&m.replace?a.history.replaceState(l,h,p.prefix+d):a.history.pushState(l,h,p.prefix+d)):a.location.href=p.prefix+d},defineRoutes:function(d,l,m){function b(){var b=p.getPath(),e={},k=f(b,e,e),n=a.history.state;if(null!=n)for(var u in n)e[u]=n[u];for(var r in d)if(n=new RegExp("^"+r.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$"),n.test(k)){k.replace(n,function(){for(var a=r.match(/:[^\/]+/g)||[],f=[].slice.call(arguments,
1,-2),h=0;h<a.length;h++)e[a[h].replace(/:|\./g,"")]=decodeURIComponent(f[h]);l(d[r],e,b,r)});return}m(b,e)}k?a.onpopstate=e(b):"#"===p.prefix.charAt(0)&&(a.onhashchange=b);b()}};return p};w.route=function(a,d){var e=X(a),f=function(a){return a},k,l,m,p,n,r=function(a,r,h){function b(){null!=k&&d.render(a,k(x(l,m.key,m)))}if(null==a)throw Error("Ensure the DOM element that was passed to `m.route` is not undefined");var u=function(){b();u=d.redraw};d.subscribe(a,b);var w=function(a){if(a!==r)e.setPath(r,
null,{replace:!0});else throw Error("Could not resolve default route "+r);};e.defineRoutes(h,function(a,b,d){var e=n=function(a,h){e===n&&(l=null==h||"function"!==typeof h.view&&"function"!==typeof h?"div":h,m=b,p=d,n=null,k=(a.render||f).bind(a),u())};a.view||"function"===typeof a?e({},a):a.onmatch?W.resolve(a.onmatch(b,d)).then(function(b){e(a,b)},w):e(a,"div")},w)};r.set=function(a,d,f){null!=n&&(f=f||{},f.replace=!0);n=null;e.setPath(a,d,f)};r.get=function(){return p};r.prefix=function(a){e.prefix=
a};var w=function(a,d){d.dom.setAttribute("href",e.prefix+d.attrs.href);d.dom.onclick=function(b){b.ctrlKey||b.metaKey||b.shiftKey||2===b.which||(b.preventDefault(),b.redraw=!1,b=this.getAttribute("href"),0===b.indexOf(e.prefix)&&(b=b.slice(e.prefix.length)),r.set(b,void 0,a))}};r.link=function(a){return null==a.tag?w.bind(w,a):w({},a)};r.param=function(a){return"undefined"!==typeof m&&"undefined"!==typeof a?m[a]:m};return r}(window,F);w.withAttr=function(a,d,e){return function(f){d.call(e||this,
a in f.currentTarget?f.currentTarget[a]:f.currentTarget.getAttribute(a))}};var Y=Q(window);w.render=Y.render;w.redraw=F.redraw;w.request=K.request;w.jsonp=K.jsonp;w.parseQueryString=L;w.buildQueryString=E;w.version="1.1.3";w.vnode=x;w.PromisePolyfill=n;"undefined"!==typeof module?module.exports=w:window.m=w})();