/* Mithril v0.1.8 http://github.com/lhorie/mithril.js (c) Leo Horie License: MIT */ !new function(a){function b(f,g,h,i,j,k){if(null===g||void 0===g)return void(h&&d(h.nodes));if("retain"!==g.subtree){var l=t.call(h),m=t.call(g);if(l!=m&&(null!==h&&void 0!==h&&d(h.nodes),h=new g.constructor,h.nodes=[]),"[object Array]"==m){for(var n=[],o=h.length===g.length,p=0,q=0;q-1?new g.constructor(g):g,h.nodes=[s];else if(h.valueOf()!==g.valueOf()||i===!0){if(g.$trusted){var v=h.nodes[0],n=[v];if(v){for(;v=v.nextSibling;)n.push(v);d(n),s=e(f,j,g)}else f.innerHTML=g}else s=h.nodes[0],f.insertBefore(s,f.childNodes[j]||null),s.nodeValue=g;h=new g.constructor(g),h.nodes=[s]}else h.nodes.intact=!0}return h}}function c(b,c,d,e){for(var f in c){var h=c[f],i=d[f];if(!(f in d)||i!==h||b===a.document.activeElement){if(d[f]=h,"config"===f)continue;if("function"==typeof h&&0==f.indexOf("on"))b[f]=g(h,b);else if("style"===f)for(var j in h)(void 0===i||i[j]!==h[j])&&(b.style[j]=h[j]);else void 0!==e?"href"===f?b.setAttributeNS("http://www.w3.org/1999/xlink","href",h):"className"===f?b.setAttribute("class",h):b.setAttribute(f,h):f in b?b[f]=h:b.setAttribute(f,h)}}return d}function d(a){for(var b=0;b16)m.redraw();else{var b=a.cancelAnimationFrame||a.clearTimeout,c=a.requestAnimationFrame||a.setTimeout;b(F),F=c(m.redraw,0)}}function i(a,b,c){K={};for(var d in b){if(d==c)return!void m.module(a,b[d]);var e=new RegExp("^"+d.replace(/:[^\/]+/g,"([^\\/]+)")+"$");if(e.test(c))return!void c.replace(e,function(){for(var c=d.match(/:[^\/]+/g),e=[].slice.call(arguments,1,-2),f=0;f0&&("GET"==a.method?a.url=a.url+(a.url.indexOf("?")<0?"?":"&")+o(b):a.data=c(b)),a}function q(a,b){var c=a.match(/:[a-z]\w+/gi);if(c&&b)for(var d=0;d0&&(e.attrs[d]=h.join(" "))}e=f(e),e.attrs=f(e.attrs),e.children=b?a[2]:a[1];for(var j in c)e.attrs[j]=j==d?(e.attrs[j]||"")+" "+c[j]:c[j];return e};var w,x={insertAdjacentHTML:function(b,c){a.document.write(c),a.document.close()},appendChild:function(b){void 0===w&&(w=a.document.createElement("html")),"HTML"==b.nodeName?w=b:w.appendChild(b),a.document.documentElement!==w&&a.document.replaceChild(w,a.document.documentElement)},insertBefore:function(a){this.appendChild(a)},childNodes:[]},y=[],z={};m.render=function(c,d){var e=y.indexOf(c),f=0>e?y.push(c)-1:e,g=c==a.document||c==a.document.documentElement?x:c;z[f]=b(g,d,z[f],!1,0)},m.trust=function(a){return a=new String(a),a.$trusted=!0,a};var A,B={view:function(){}},C={},D=0,E=0,F=0;m.module=function(a,b){m.startComputation(),A=a,B=b,C=new b.controller,m.endComputation()},m.redraw=function(){m.render(A,B.view(C)),E=D};var G=0,H=null;m.startComputation=function(){G++},m.endComputation=function(){G=Math.max(G-1,0),0==G&&(h(),H&&(H(),H=null))},m.withAttr=function(a,b){return function(c){b(a in c.currentTarget?c.currentTarget[a]:c.currentTarget.getAttribute(a))}};var I={pathname:"",hash:"#",search:"?"},J=function(){},K={};m.route=function(){if(3==arguments.length){var b=arguments[0],c=arguments[1],d=arguments[2];J=function(a){var e=a.slice(I[m.route.mode].length);i(b,d,e)||m.route(c,!0)};var e="hash"==m.route.mode?"onhashchange":"onpopstate";a[e]=function(){J(a.location[m.route.mode])},H=k,a[e]()}else if(arguments[0].addEventListener){var f=arguments[0],g=arguments[1];g||(f.removeEventListener("click",j),f.addEventListener("click",j))}else if("string"==typeof arguments[0]){var h=arguments[0],l=arguments[1]===!0;a.history.pushState?(H=function(){a.history[l?"replaceState":"pushState"](null,a.document.title,I[m.route.mode]+h),k()},J(I[m.route.mode]+h)):a.location[m.route.mode]=h}},m.route.param=function(a){return K[a]},m.route.mode="search",m.prop=function(a){return function(){return arguments.length&&(a=arguments[0]),a}},m.deferred=function(){var a=[],b=[],c={resolve:function(b){for(var c=0;c