!function(){"use strict";function e(e,t,n,l,r,o){return{tag:e,key:t,attrs:n,children:l,text:r,dom:o,domSize:void 0,state:void 0,events:void 0,instance:void 0}}e.normalize=function(t){return Array.isArray(t)?e("[",void 0,void 0,e.normalizeChildren(t),void 0,void 0):null==t||"boolean"==typeof t?null:"object"==typeof t?t:e("#",void 0,void 0,String(t),void 0,void 0)},e.normalizeChildren=function(t){var n=[];if(t.length){for(var l=null!=t[0]&&null!=t[0].key,r=1;r0&&(i.className=o.join(" ")),r[e]={tag:n,attrs:i}}function i(e,t){var l=t.attrs,r=n.call(l,"class"),o=r?l.class:l.className;if(t.tag=e.tag,!function(e){for(var t in e)if(n.call(e,t))return!1;return!0}(e.attrs)){var i={};for(var a in l)n.call(l,a)&&(i[a]=l[a]);l=i}for(var a in e.attrs)n.call(e.attrs,a)&&"className"!==a&&!n.call(l,a)&&(l[a]=e.attrs[a]);return null==o&&null==e.attrs.className||(l.className=null!=o?null!=e.attrs.className?String(e.attrs.className)+" "+String(o):o:null!=e.attrs.className?e.attrs.className:null),r&&(l.class=null),t.attrs=l,t}function a(n){if(null==n||"string"!=typeof n&&"function"!=typeof n&&"function"!=typeof n.view)throw Error("The selector must be either a string or a component.");var l=t.apply(1,arguments);return"string"==typeof n&&(l.children=e.normalizeChildren(l.children),"["!==n)?i(r[n]||o(n),l):(l.tag=n,l)}a.trust=function(t){return null==t&&(t=""),e("<",void 0,void 0,t,void 0,void 0)},a.fragment=function(){var n=t.apply(0,arguments);return n.tag="[",n.children=e.normalizeChildren(n.children),n};var u=new WeakMap;var s={delayedRemoval:u,domFor:function*(e,t={}){var n=e.dom,l=e.domSize,r=t.generation;if(null!=n)do{var o=n.nextSibling;u.get(n)===r&&(yield n,l--),n=o}while(l)}},f=s.delayedRemoval,d=s.domFor,c=function(){var t,n,l={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function r(e){return e.ownerDocument}function o(e){return e.attrs&&e.attrs.xmlns||l[e.tag]}function i(e,t){if(e.state!==t)throw new Error("'vnode.state' must not be modified.")}function a(e){var t=e.state;try{return this.apply(t,arguments)}finally{i(e,t)}}function u(e){try{return r(e).activeElement}catch(e){return null}}function s(e,t,n,l,r,o,i){for(var a=n;a'+t.children+"",i=i.firstChild):i.innerHTML=t.children,t.dom=i.firstChild,t.domSize=i.childNodes.length;for(var a,u=r(e).createDocumentFragment();a=i.firstChild;)u.appendChild(a);k(e,u,l)}function h(e,t,n,l,r,o){if(t!==n&&(null!=t||null!=n))if(null==t||0===t.length)s(e,n,0,n.length,l,r,o);else if(null==n||0===n.length)x(e,t,0,t.length);else{var i=null!=t[0]&&null!=t[0].key,a=null!=n[0]&&null!=n[0].key,u=0,f=0;if(!i)for(;f=f&&A>=u&&(v=t[S],h=n[A],v.key===h.key);)v!==h&&g(e,v,h,l,r,o),null!=h.dom&&(r=h.dom),S--,A--;for(;S>=f&&A>=u&&(d=t[f],m=n[u],d.key===m.key);)f++,u++,d!==m&&g(e,d,m,l,w(t,f,r),o);for(;S>=f&&A>=u&&u!==A&&d.key===h.key&&v.key===m.key;)b(e,v,k=w(t,f,r)),v!==m&&g(e,v,m,l,k,o),++u<=--A&&b(e,d,r),d!==h&&g(e,d,h,l,r,o),null!=h.dom&&(r=h.dom),f++,v=t[--S],h=n[A],d=t[f],m=n[u];for(;S>=f&&A>=u&&v.key===h.key;)v!==h&&g(e,v,h,l,r,o),null!=h.dom&&(r=h.dom),A--,v=t[--S],h=n[A];if(u>A)x(e,t,f,S+1);else if(f>S)s(e,n,u,A+1,l,r,o);else{var E,$,N=r,C=A-u+1,j=new Array(C),L=0,T=0,F=2147483647,I=0;for(T=0;T=u;T--){null==E&&(E=p(t,f,S+1));var M=E[(h=n[T]).key];null!=M&&(F=M>>1)+(l>>>1)+(n&l&1);e[t[a]]0&&(y[r]=t[n-1]),t[n]=r)}}n=t.length,l=t[n-1];for(;n-- >0;)t[n]=l,l=y[l];return y.length=0,t}(j)).length-1,T=A;T>=u;T--)m=n[T],-1===j[T-u]?c(e,m,l,o,r):$[L]===T-u?L--:b(e,m,r),null!=m.dom&&(r=n[T].dom);else for(T=A;T>=u;T--)m=n[T],-1===j[T-u]&&c(e,m,l,o,r),null!=m.dom&&(r=n[T].dom)}}else{var O=t.lengthO&&x(e,t,u,t.length),n.length>O&&s(e,n,u,n.length,l,r,o)}}}function g(t,n,l,r,i,u){var s=n.tag;if(s===l.tag){if(l.state=n.state,l.events=n.events,function(e,t){do{var n;if(null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate)if(void 0!==(n=a.call(e.attrs.onbeforeupdate,e,t))&&!n)break;if("string"!=typeof e.tag&&"function"==typeof e.state.onbeforeupdate)if(void 0!==(n=a.call(e.state.onbeforeupdate,e,t))&&!n)break;return!1}while(0);return e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,e.attrs=t.attrs,e.children=t.children,e.text=t.text,!0}(l,n))return;if("string"==typeof s)switch(null!=l.attrs&&H(l.attrs,l,r),s){case"#":!function(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children);t.dom=e.dom}(n,l);break;case"<":!function(e,t,n,l,r){t.children!==n.children?(A(e,t,void 0),v(e,n,l,r)):(n.dom=t.dom,n.domSize=t.domSize)}(t,n,l,u,i);break;case"[":!function(e,t,n,l,r,o){h(e,t.children,n.children,l,r,o);var i=0,a=n.children;if(n.dom=null,null!=a){for(var u=0;u-1||null!=e.attrs&&e.attrs.is||"href"!==t&&"list"!==t&&"form"!==t&&"width"!==t&&"height"!==t)&&t in e.dom}var L,T=/[A-Z]/g;function F(e){return"-"+e.toLowerCase()}function I(e){return"-"===e[0]&&"-"===e[1]?e:"cssFloat"===e?"float":e.replace(T,F)}function M(e,t,n){if(t===n);else if(null==n)e.style="";else if("object"!=typeof n)e.style=n;else if(null==t||"object"!=typeof t)for(var l in e.style.cssText="",n){null!=(r=n[l])&&e.style.setProperty(I(l),String(r))}else{for(var l in n){var r;null!=(r=n[l])&&(r=String(r))!==String(t[l])&&e.style.setProperty(I(l),r)}for(var l in t)null!=t[l]&&null==n[l]&&e.style.removeProperty(I(l))}}function O(){this._=t}function D(e,n,l){if(null!=e.events){if(e.events._=t,e.events[n]===l)return;null==l||"function"!=typeof l&&"object"!=typeof l?(null!=e.events[n]&&e.dom.removeEventListener(n.slice(2),e.events,!1),e.events[n]=void 0):(null==e.events[n]&&e.dom.addEventListener(n.slice(2),e.events,!1),e.events[n]=l)}else null==l||"function"!=typeof l&&"object"!=typeof l||(e.events=new O,e.dom.addEventListener(n.slice(2),e.events,!1),e.events[n]=l)}function P(e,t,n){"function"==typeof e.oninit&&a.call(e.oninit,t),"function"==typeof e.oncreate&&n.push(a.bind(e.oncreate,t))}function H(e,t,n){"function"==typeof e.onupdate&&n.push(a.bind(e.onupdate,t))}return O.prototype=Object.create(null),O.prototype.handleEvent=function(e){var t,n=this["on"+e.type];"function"==typeof n?t=n.call(e.currentTarget,e):"function"==typeof n.handleEvent&&n.handleEvent(e),this._&&!1!==e.redraw&&(0,this._)(),!1===t&&(e.preventDefault(),e.stopPropagation())},function(l,r,o){if(!l)throw new TypeError("DOM element being rendered to does not exist.");if(null!=L&&l.contains(L))throw new TypeError("Node is currently being rendered to and thus is locked.");var i=t,a=L,s=[],f=u(l),d=l.namespaceURI;L=l,t="function"==typeof o?o:void 0,n={};try{null==l.vnodes&&(l.textContent=""),r=e.normalizeChildren(Array.isArray(r)?r:[r]),h(l,l.vnodes,r,s,null,"http://www.w3.org/1999/xhtml"===d?void 0:d),l.vnodes=r,null!=f&&u(l)!==f&&"function"==typeof f.focus&&f.focus();for(var c=0;c=0&&(r.splice(o,2),o<=i&&(i-=2),t(n,[])),null!=l&&(r.push(n,l),t(n,e(l),u))},redraw:u}}(c,"undefined"!=typeof requestAnimationFrame?requestAnimationFrame:null,"undefined"!=typeof console&&console),v=s,h=function(){return a.apply(this,arguments)};h.m=a,h.trust=a.trust,h.fragment=a.fragment,h.Fragment="[",h.mount=m.mount,h.render=c,h.redraw=m.redraw,h.vnode=e,h.domFor=v.domFor,"undefined"!=typeof module?module.exports=h:window.m=h}();