/*! For license information please see demo-386.js.LICENSE.txt */ !function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";function r(t){return t.replace(/-(\w)/g,(t,e)=>e.toUpperCase())}function o(t){Array.from(t).forEach(s)}function s(t){const{parentNode:e}=t;t.remove?t.remove():e&&e.removeChild(t)}n.r(e);var i={EACH:0,IF:1,SIMPLE:2,TAG:3,SLOT:4};var u={ATTRIBUTE:0,EVENT:1,TEXT:2,VALUE:3};const{indexOf:a,slice:c}=[],l=(t,e,n,r,o,s)=>{const i="selectedIndex"in e;let u=i;for(;rt==e,d=t=>t,p=(t,e,n,r,o,s,i)=>{const u=s-o;if(u<1)return-1;for(;n-e>=u;){let u=e,a=o;for(;un{for(;n{let r=1,o=e;for(;r>>0;n{((t,e,n,r,o,s,i,u,a)=>{const c=[],h=t.length;let d=i,p=0;for(;p{const u=n+s,a=[];let c,l,h,d,p,f,m;t:for(c=0;c<=u;c++){if(c>50)return null;for(m=c-1,p=c?a[c-1]:[0,0],f=a[c]=[],l=-c;l<=c;l+=2){for(d=l===-c||l!==c&&p[m+l-1]=0;c--){for(;d>0&&h>0&&i(r[o+d-1],t[e+h-1]);)b[O--]=0,d--,h--;if(!c)break;m=c-1,p=c?a[c-1]:[0,0],l=d-h,l===-c||l!==c&&p[m+l-1]{let a=0,c=ri;)--a;c=u+r-a;const p=Array(c);let f=l[a];for(--n;f;){const{newi:t,oldi:e}=f;for(;n>t;)p[--c]=1,--n;for(;i>e;)p[--c]=-1,--i;p[--c]=0,--n,--i,f=f.prev}for(;n>=e;)p[--c]=1,--n;for(;i>=s;)p[--c]=-1,--i;return p})(n,r,o,s,i,u,a,c),t,e,n,r,i,u,h,p)},g=t=>(t.remove||v).call(t);function v(){const{parentNode:t}=this;t&&t.removeChild(this)}function y(t,e){return typeof t===e}function E(t){const e=t.ownerSVGElement;return!!e||null===e}function N(t){return!j(t.content)}function T(t){return y(t,"function")}function M(t){return!j(t)&&y(t,"object")}function j(t){return null==t}const _=Symbol("unmount"),A=Object.seal({nodes:[],mount(t,e){return this.update(t,e)},update(t,e){const{placeholder:n,nodes:r,childrenMap:o}=this,s=t===_?null:this.evaluate(t),i=s?Array.from(s):[],u=n.parentNode,{newChildrenMap:a,batches:c,futureNodes:b}=function(t,e,n,r){const{condition:o,template:s,childrenMap:i,itemName:u,getKey:a,indexName:c,root:l,isTemplateTag:h}=r,d=new Map,p=[],f=[];return t.forEach((t,r)=>{const m=function(t,e){let{itemName:n,indexName:r,index:o,item:s}=e;t[n]=s,r&&(t[r]=o);return t}(Object.create(e),{itemName:u,indexName:c,index:r,item:t}),b=a?a(m):r,O=i.get(b);if(function(t,e){return!!t&&!1===Boolean(t(e))}(o,m))return;const g=O?O.template:s.clone(),v=O?g.el:l.cloneNode(),y=!O,E=h&&y?function(t){const e=t.dom.cloneNode(!0);return{avoidDOMInjection:!0,fragment:e,children:Array.from(e.childNodes)}}(g):{};if(y?p.push(()=>g.mount(v,m,n,E)):p.push(()=>g.update(m,n)),h){const t=E.children||g.children;f.push(...t)}else f.push(v);i.delete(b),d.set(b,{template:g,context:m,index:r})}),{newChildrenMap:d,batches:p,futureNodes:f}}(i,t,e,this);return((t,e,n,r)=>{r||(r={});const o=r.compare||h,s=r.node||d,i=null==r.before?null:s(r.before,0),u=e.length;let a=u,c=0,b=n.length,g=0;for(;c{for(;rt()),this.childrenMap=a,this.nodes=b,this},unmount(t,e){return this.update(_,e),this}});function x(t,e){return(n,r)=>{if(r<0){const n=t.pop();if(n){const{template:t,context:r}=n;t.unmount(r,e,null)}}return n}}const w=Object.seal({mount(t,e){return this.update(t,e)},update(t,e){const n=!!this.evaluate(t),r=!this.value&&n,o=this.value&&!n,s=()=>{const n=this.node.cloneNode();this.placeholder.parentNode.insertBefore(n,this.placeholder),this.template=this.template.clone(),this.template.mount(n,t,e)};switch(!0){case r:s();break;case o:this.unmount(t);break;default:n&&this.template.update(t,e)}return this.value=n,this},unmount(t,e){return this.template.unmount(t,e,!0),this}});function S(t){throw new Error(t)}function P(t){return t.reduce((t,e)=>{const{value:n,type:o}=e;switch(!0){case!e.name&&0===o:return Object.assign({},t,n);case 3===o:t.value=e.value;break;default:t[r(e.name)]=e.value}return t},{})}const U="undefined"==typeof Element?{}:Element.prototype,C=function(t){const e=new Map,n=n=>(e.has(n)||e.set(n,t.call(this,n)))&&e.get(n);return n.cache=e,n}(t=>U.hasOwnProperty(t));function D(t,e,n,r){let{name:o}=e;if(!o)return r&&function(t,e,n){const r=e?Object.keys(e):[];Object.keys(n).filter(t=>!r.includes(t)).forEach(e=>t.removeAttribute(e))}(t,n,r),void(n&&function(t,e){Object.entries(e).forEach(e=>{let[n,r]=e;return D(t,{name:n},r)})}(t,n));!C(o)&&(function(t){return y(t,"boolean")}(n)||M(n)||T(n))&&(t[o]=n),t[function(t){return j(t)||!1===t||""===t||M(t)||T(t)?"removeAttribute":"setAttribute"}(n)](o,function(t,e){return!0===e?t:e}(o,n))}const B=/^on/,I={handleEvent(t){this[t.type](t)}},L=new WeakMap;function Y(t){return j(t)?"":t}const K=(t,e)=>{const n=t.childNodes[e];if(n.nodeType===Node.COMMENT_NODE){const e=document.createTextNode("");return t.replaceChild(e,n),e}return n};var k={0:D,1:function(t,e,n){let{name:r}=e;const o=r.replace(B,""),s=L.get(t)||(t=>{const e=Object.create(I);return L.set(t,e),e})(t),[i,u]=(t=>Array.isArray(t)?t:[t,!1])(n),a=s[o],c=i&&!a;a&&!i&&t.removeEventListener(o,s),c&&t.addEventListener(o,s,u),s[o]=i},2:function(t,e,n){t.data=Y(n)},3:function(t,e,n){t.value=Y(n)}};const R=Object.seal({mount(t){return this.value=this.evaluate(t),$(this,this.value),this},update(t){const e=this.evaluate(t);return this.value!==e&&($(this,e),this.value=e),this},unmount(){return 1===this.type&&$(this,null),this}});function $(t,e){return k[t.type](t.node,t,e,t.value)}function H(t,e){return Object.assign({},R,e,{node:2===e.type?K(t,e.childNodeIndex):t})}const z=new Map,F=Symbol("riot-component"),G=new Set,V="mount",q="update",W="unmount",X=Symbol.for("pure"),Z=Symbol("parent"),J=Symbol("attributes"),Q=Symbol("template");var tt=Object.freeze({__proto__:null,COMPONENTS_IMPLEMENTATION_MAP:z,DOM_COMPONENT_INSTANCE_PROPERTY:F,PLUGINS_SET:G,IS_DIRECTIVE:"is",VALUE_ATTRIBUTE:"value",MOUNT_METHOD_KEY:V,UPDATE_METHOD_KEY:q,UNMOUNT_METHOD_KEY:W,SHOULD_UPDATE_KEY:"shouldUpdate",ON_BEFORE_MOUNT_KEY:"onBeforeMount",ON_MOUNTED_KEY:"onMounted",ON_BEFORE_UPDATE_KEY:"onBeforeUpdate",ON_UPDATED_KEY:"onUpdated",ON_BEFORE_UNMOUNT_KEY:"onBeforeUnmount",ON_UNMOUNTED_KEY:"onUnmounted",PROPS_KEY:"props",STATE_KEY:"state",SLOTS_KEY:"slots",ROOT_KEY:"root",IS_PURE_SYMBOL:X,PARENT_KEY_SYMBOL:Z,ATTRIBUTES_KEY_SYMBOL:J,TEMPLATE_KEY_SYMBOL:Q});const et=(t,e)=>e?e===t?t[Z]:e:void 0,nt=Object.seal({attributes:[],getTemplateScope(t,e){return function(t,e,n){if(!t||!t.length)return n;const r=t.map(t=>Object.assign({},t,{value:t.evaluate(e)}));return Object.assign(Object.create(n||null),P(r))}(this.attributes,t,e)},mount(t,e){const n=!!t.slots&&t.slots.find(t=>{let{id:e}=t;return e===this.name}),{parentNode:r}=this.node,o=et(t,e);return this.template=n&&ht(n.html,n.bindings).createDOM(r),this.template&&(this.template.mount(this.node,this.getTemplateScope(t,o),o),this.template.children=function t(e,n){void 0===n&&(n=[]);const r=e.firstChild;if(r)return e.parentNode.insertBefore(r,e),[r,...t(e)];return n}(this.node)),s(this.node),this},update(t,e){if(this.template){const n=et(t,e);this.template.update(this.getTemplateScope(t,n),n)}return this},unmount(t,e,n){return this.template&&this.template.unmount(this.getTemplateScope(t,e),null,n),this}});function rt(t){return t.reduce((t,e)=>{let{bindings:n}=e;return t.concat(n)},[])}const ot=Object.seal({mount(t){return this.update(t)},update(t,e){const n=this.evaluate(t);return n===this.name?this.tag.update(t):(this.unmount(t,e,!0),this.name=n,this.tag=function(t,e,n){return void 0===e&&(e=[]),void 0===n&&(n=[]),t?t({slots:e,attributes:n}):ht(function(t){return t.reduce((t,e)=>t+e.html,"")}(e),[...rt(e),{expressions:n.map(t=>Object.assign({type:0},t))}])}(this.getComponent(n),this.slots,this.attributes),this.tag.mount(this.node,t)),this},unmount(t,e,n){return this.tag&&this.tag.unmount(n),this}});var st={1:function(t,e){let{evaluate:n,template:r}=e;const o=t.parentNode,i=document.createTextNode("");return o.insertBefore(i,t),s(t),Object.assign({},w,{node:t,evaluate:n,placeholder:i,template:r.createDOM(t)})},2:function(t,e){let{expressions:n}=e;return Object.assign({},(r=n.map(e=>H(t,e)),["mount","update","unmount"].reduce((t,e)=>Object.assign({},t,{[e]:t=>r.map(n=>n[e](t))&&o}),{})));var r,o},0:function(t,e){let{evaluate:n,condition:r,itemName:o,indexName:i,getKey:u,template:a}=e;const c=document.createTextNode(""),l=t.parentNode,h=t.cloneNode();return l.insertBefore(c,t),s(t),Object.assign({},A,{childrenMap:new Map,node:t,root:h,condition:r,evaluate:n,isTemplateTag:N(h),template:a.createDOM(t),getKey:u,indexName:i,itemName:o,placeholder:c})},3:function(t,e){let{evaluate:n,getComponent:r,slots:o,attributes:s}=e;return Object.assign({},ot,{node:t,evaluate:n,slots:o,attributes:s,getComponent:r})},4:function(t,e){let{name:n,attributes:r}=e;return Object.assign({},nt,{attributes:r,node:t,name:n})}};function it(t,e){return t.map(t=>2===t.type?Object.assign({},t,{childNodeIndex:t.childNodeIndex+e}):t)}function ut(t,e,n){const{selector:r,type:o,redundantAttribute:s,expressions:i}=e,u=r?t.querySelector(r):t;s&&u.removeAttribute(s);const a=i||[];return(st[o]||st[2])(u,Object.assign({},e,{expressions:n&&!r?it(a,n):a}))}function at(t,e){return E(t)?function(t,e){return e.ownerDocument.importNode((new window.DOMParser).parseFromString(`${t}`,"application/xml").documentElement,!0)}(e,t):function(t,e){const n=N(e)?e:document.createElement("template");return n.innerHTML=t,n.content}(e,t)}function ct(t,e){switch(!0){case E(t):!function t(e,n){e.firstChild&&(n.appendChild(e.firstChild),t(e,n))}(e,t);break;case N(t):t.parentNode.replaceChild(e,t);break;default:t.appendChild(e)}}const lt=Object.freeze({createDOM(t){return this.dom=this.dom||function(t,e){return e&&("string"==typeof e?at(t,e):e)}(t,this.html),this},mount(t,e,n,r){if(void 0===r&&(r={}),!t)throw new Error("Please provide DOM node to mount properly your template");this.el&&this.unmount(e);const{fragment:o,children:s,avoidDOMInjection:i}=r,{parentNode:u}=s?s[0]:t,a=N(t),c=a?Math.max(Array.from(u.childNodes).indexOf(t),0):null;return this.isTemplateTag=a,this.createDOM(t),this.dom&&(this.fragment=o||this.dom.cloneNode(!0)),this.el=this.isTemplateTag?u:t,this.children=this.isTemplateTag?s||Array.from(this.fragment.childNodes):null,!i&&this.fragment&&ct(t,this.fragment),this.bindings=this.bindingsData.map(t=>ut(this.el,t,c)),this.bindings.forEach(t=>t.mount(e,n)),this},update(t,e){return this.bindings.forEach(n=>n.update(t,e)),this},unmount(t,e,n){if(this.el){switch(this.bindings.forEach(r=>r.unmount(t,e,n)),!0){case this.children&&null!==n:o(this.children);break;case!0===n:s(this.el);break;case null!==n:o(this.el.childNodes)}this.el=null}return this},clone(){return Object.assign({},this,{el:null})}});function ht(t,e){return void 0===e&&(e=[]),Object.assign({},lt,{html:t,bindingsData:e})}function dt(){return this}function pt(t){return T(t)?t.prototype&&t.prototype.constructor?new t:t():t}function ft(t,e,n,r){return void 0===r&&(r={}),Object.defineProperty(t,e,Object.assign({value:n,enumerable:!1,writable:!1,configurable:!0},r)),t}function mt(t,e,n){return Object.entries(e).forEach(e=>{let[r,o]=e;ft(t,r,o,n)}),t}function bt(t,e){return Object.entries(e).forEach(e=>{let[n,r]=e;t[n]||(t[n]=r)}),t}function Ot(t){return Array.isArray(t)?t:/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(t))&&"number"==typeof t.length?Array.from(t):[t]}function gt(t,e){return Ot("string"==typeof t?(e||document).querySelectorAll(t):t)}const vt=t=>1===t.length?t[0]:t;function yt(t,e,n){const r="object"==typeof e?e:{[e]:n},o=Object.keys(r);return Ot(t).forEach(t=>{o.forEach(e=>t.setAttribute(e,r[e]))}),t}function Et(t,e){return function(t,e,n){const r="string"==typeof e?[e]:e;return vt(Ot(t).map(t=>vt(r.map(e=>t[n](e)))))}(t,e,"getAttribute")}const Nt=new Map,Tt=()=>Mt||(yt(Mt=gt("style[riot]")[0]||document.createElement("style"),"type","text/css"),Mt.parentNode||document.head.appendChild(Mt),Mt);var Mt,jt={CSS_BY_NAME:Nt,add(t,e){return Nt.has(t)||(Nt.set(t,e),this.inject()),this},inject(){return Tt().innerHTML=[...Nt.values()].join("\n"),this},remove(t){return Nt.has(t)&&(Nt.delete(t),this.inject()),this}};function _t(t){return Et(t,"is")||t.tagName.toLowerCase()}const At=Object.freeze({$(t){return gt(t,this.root)[0]},$$(t){return gt(t,this.root)}}),xt=Object.freeze({[V]:dt,[q]:dt,[W]:dt}),wt=Object.freeze({shouldUpdate:dt,onBeforeMount:dt,onMounted:dt,onBeforeUpdate:dt,onUpdated:dt,onBeforeUnmount:dt,onUnmounted:dt}),St=Object.assign({},xt,{clone:dt,createDOM:dt});function Pt(t,e){return void 0===e&&(e={}),Object.assign({},function(t){return Array.from(t.attributes).reduce((t,e)=>(t[r(e.name)]=e.value,t),{})}(t),pt(e))}const Ut=(t,e)=>t[F]=e;function Ct(t){return[V,q,W].reduce((e,n)=>(e[n]=t(n),e),{})}function Dt(t){let{css:e,template:n,exports:r,name:o}=t;const s=n?function(t,e){return t(ht,u,i,t=>e[t]||z.get(t))}(n,r?function(t){void 0===t&&(t={});return Object.entries(pt(t)).reduce((t,e)=>{let[n,r]=e;var o;return t[(o=n,o.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())]=Dt(r),t},{})}(r.components):{}):St;return t=>{let{slots:i,attributes:u,props:a}=t;if(r&&r[X])return function(t,e){let{slots:n,attributes:r,props:o,css:s,template:i}=e;i&&S("Pure components can not have html"),s&&S("Pure components do not have css");const u=bt(t({slots:n,attributes:r,props:o}),xt);return Ct(t=>function(){for(var e=arguments.length,n=new Array(e),r=0;rl.mount(t,n,e),update:(t,e)=>l.update(e,t),unmount:t=>l.unmount(t)}}}function Bt(t){let{css:e,template:n,componentAPI:r,name:o}=t;return e&&o&&jt.add(o,e),function t(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;oe(t)||t,t)}(mt(Object.create(t),{mount(e,s,i){return void 0===s&&(s={}),this[J]=function(t,e){void 0===e&&(e=[]);const n=e.map(e=>H(t,e)),r={};return Object.assign(r,Object.assign({expressions:n},Ct(t=>e=>(n.forEach(n=>n[t](e)),r))))}(e,r).mount(i),ft(this,"props",Object.freeze(Object.assign({},Pt(e,o),P(this[J].expressions)))),this.state=It(this.state,s),this[Q]=this.template.createDOM(e).clone(),Ut(e,this),t.name&&function(t,e){_t(t)!==e&&yt(t,"is",e)}(e,t.name),ft(this,"root",e),ft(this,"slots",n),this.onBeforeMount(this.props,this.state),this[Z]=i,this[Q].mount(e,this,i),this.onMounted(this.props,this.state),this},update(t,e){void 0===t&&(t={}),e&&this[J].update(e);const n=P(this[J].expressions);if(!1!==this.shouldUpdate(n,this.props))return ft(this,"props",Object.freeze(Object.assign({},this.props,n))),this.state=It(this.state,t),this.onBeforeUpdate(this.props,this.state),this[Q].update(this,this[Z]),this.onUpdated(this.props,this.state),this},unmount(t){return this.onBeforeUnmount(this.props,this.state),this[J].unmount(),this[Q].unmount(this,this[Z],null===t?null:!t),this.onUnmounted(this.props,this.state),this}})),Object.keys(t).filter(e=>T(t[e])).forEach(t=>{s[t]=s[t].bind(s)}),s;var s}const{DOM_COMPONENT_INSTANCE_PROPERTY:Yt,COMPONENTS_IMPLEMENTATION_MAP:Kt,PLUGINS_SET:kt}=tt;var Rt,$t,Ht,zt={css:null,exports:{state:{show:2,interval:1e3},onMounted(){this.$$(".tiny-fade > *").forEach((t,e)=>{t.classList.add("tiny-fade__item"),this.state.show>e&&t.classList.add("tiny-fade__item--active")});setInterval(()=>{this.toggle()},this.state.interval)},toggle(){const t=this.$(".tiny-fade__item--active:last-child");console.log(t)}},template:function(t,e,n,r){return t('
',[{type:n.TAG,getComponent:r,evaluate:function(t){return"slot-html"},slots:[],attributes:[],redundantAttribute:"expr0",selector:"[expr0]"}])},name:"tiny-fade"};T(Rt=function(t){var e=t.onBeforeMount,n=t.onMounted;return t.onBeforeMount=function(){var n=t.root.innerHTML;n&&(t.root.innerHTML="",Object.defineProperty(t,"slot-html",{value:n,enumerable:!1,writable:!1,configurable:!0}));for(var r=arguments.length,o=new Array(r),s=0;sfunction(t,e,n){const r=n||_t(t);return z.has(r)||S(`The component named "${r}" was never registered`),z.get(r)({props:e}).mount(t)}(t,$t,Ht))}]);