|
(()=>{"use strict";var t={962:()=>{function t(t){return t.replace(/-(\w)/g,((t,e)=>e.toUpperCase()))}function e(t,n){t.firstChild&&(n.appendChild(t.firstChild),e(t,n))}function n(t){Array.from(t).forEach(r)}const r=t=>t&&t.parentNode&&t.parentNode.removeChild(t),s=(t,e)=>e&&e.parentNode&&e.parentNode.insertBefore(t,e),i=new Map,o=Symbol("riot-component"),a=new Set,u="is",c="mount",l="update",h="unmount",p="shouldUpdate",d="onBeforeMount",m="onMounted",f="onBeforeUpdate",b="onUpdated",O="onBeforeUnmount",g="onUnmounted",E="props",v="state",N="slots",T="root",y=Symbol.for("pure"),_=Symbol("parent"),M=Symbol("attributes"),j=Symbol("template");var x=Object.freeze({__proto__:null,COMPONENTS_IMPLEMENTATION_MAP:i,DOM_COMPONENT_INSTANCE_PROPERTY:o,PLUGINS_SET:a,IS_DIRECTIVE:u,VALUE_ATTRIBUTE:"value",MOUNT_METHOD_KEY:c,UPDATE_METHOD_KEY:l,UNMOUNT_METHOD_KEY:h,SHOULD_UPDATE_KEY:p,ON_BEFORE_MOUNT_KEY:d,ON_MOUNTED_KEY:m,ON_BEFORE_UPDATE_KEY:f,ON_UPDATED_KEY:b,ON_BEFORE_UNMOUNT_KEY:O,ON_UNMOUNTED_KEY:g,PROPS_KEY:E,STATE_KEY:v,SLOTS_KEY:N,ROOT_KEY:T,IS_PURE_SYMBOL:y,PARENT_KEY_SYMBOL:_,ATTRIBUTES_KEY_SYMBOL:M,TEMPLATE_KEY_SYMBOL:j});var w={EACH:0,IF:1,SIMPLE:2,TAG:3,SLOT:4};var A={ATTRIBUTE:0,EVENT:1,TEXT:2,VALUE:3};function S(t,e){return typeof t===e}function C(t){const e=t.ownerSVGElement;return!!e||null===e}function U(t){return!D(t.content)}function P(t){return S(t,"function")}function L(t){return!D(t)&&S(t,"object")}function D(t){return null==t}const I=Symbol("unmount"),k={nodes:[],mount(t,e){return this.update(t,e)},update(t,e){const{placeholder:n,nodes:i,childrenMap:o}=this,a=t===I?null:this.evaluate(t),u=a?Array.from(a):[],{newChildrenMap:c,batches:l,futureNodes:h}=(n.parentNode,function(t,e,n,r){const{condition:s,template:i,childrenMap:o,itemName:a,getKey:u,indexName:c,root:l,isTemplateTag:h}=r,p=new Map,d=[],m=[];return t.forEach(((t,r)=>{const f=function(t,e){let{itemName:n,indexName:r,index:s,item:i}=e;t[n]=i,r&&(t[r]=s);return t}(Object.create(e),{itemName:a,indexName:c,index:r,item:t}),b=u?u(f):r,O=o.get(b);if(function(t,e){return!!t&&!1===Boolean(t(e))}(s,f))return;const g=O?O.template:i.clone(),E=O?g.el:l.cloneNode(),v=!O,N=h&&v?function(t){const e=t.dom.cloneNode(!0);return{avoidDOMInjection:!0,fragment:e,children:Array.from(e.childNodes)}}(g):{};if(v?d.push((()=>g.mount(E,f,n,N))):d.push((()=>g.update(f,n))),h){const t=N.children||g.children;m.push(...t)}else m.push(E);o.delete(b),p.set(b,{template:g,context:f,index:r})})),{newChildrenMap:p,batches:d,futureNodes:m}}(u,t,e,this));return((t,e,n,i,o)=>{const a=n.length;let u=e.length,c=a,l=0,h=0,p=null;for(;l<u||h<c;)if(u===l){const t=c<a?h?i(n[h-1],-0).nextSibling:i(n[c-h],0):o;for(;h<c;)s(i(n[h++],1),t)}else if(c===h)for(;l<u;)p&&p.has(e[l])||r(i(e[l],-1)),l++;else if(e[l]===n[h])l++,h++;else if(e[u-1]===n[c-1])u--,c--;else if(e[l]===n[c-1]&&n[h]===e[u-1]){const t=i(e[--u],-1).nextSibling;s(i(n[h++],1),i(e[l++],-1).nextSibling),s(i(n[--c],1),t),e[u]=n[c]}else{if(!p){p=new Map;let t=h;for(;t<c;)p.set(n[t],t++)}if(p.has(e[l])){const t=p.get(e[l]);if(h<t&&t<c){let r=l,o=1;for(;++r<u&&r<c&&p.get(e[r])===t+o;)o++;if(o>t-h){const r=i(e[l],0);for(;h<t;)s(i(n[h++],1),r)}else d=i(n[h++],1),(m=i(e[l++],-1))&&m.parentNode&&m.parentNode.replaceChild(d,m)}else l++}else r(i(e[l++],-1))}var d,m})(0,i,h,function(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}}(Array.from(o.values()),e),n),l.forEach((t=>t())),this.childrenMap=c,this.nodes=h,this},unmount(t,e){return this.update(I,e),this}};const Y={mount(t,e){return this.update(t,e)},update(t,e){const n=!!this.evaluate(t),r=!this.value&&n,i=this.value&&!n,o=()=>{const n=this.node.cloneNode();s(n,this.placeholder),this.template=this.template.clone(),this.template.mount(n,t,e)};switch(!0){case r:o();break;case i: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 B(t){throw new Error(t)}function K(e){return e.reduce(((e,n)=>{const{value:r,type:s}=n;switch(!0){case!n.name&&0===s:return Object.assign({},e,r);case 3===s:e.value=n.value;break;default:e[t(n.name)]=n.value}return e}),{})}const R="removeAttribute",H="setAttribute",$="undefined"==typeof Element?{}:Element.prototype,z=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=>$.hasOwnProperty(t)));function V(t,e,n,r){let{name:s}=e;if(!s)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 V(t,{name:n},r)}))}(t,n));!z(s)&&(function(t){return S(t,"boolean")}(n)||L(n)||P(n))&&(t[s]=n),t[function(t){return D(t)||!1===t||""===t||L(t)||P(t)?R:H}(n)](s,function(t,e){return!0===e?t:e}(s,n))}const F=/^on/,G={handleEvent(t){this[t.type](t)}},q=new WeakMap;function X(t){return D(t)?"":t}const W=(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 Z={0:V,1:function(t,e,n){let{name:r}=e;const s=r.replace(F,""),i=q.get(t)||(t=>{const e=Object.create(G);return q.set(t,e),e})(t),[o,a]=(t=>Array.isArray(t)?t:[t,!1])(n),u=i[s],c=o&&!u;u&&!o&&t.removeEventListener(s,i),c&&t.addEventListener(s,i,a),i[s]=o},2:function(t,e,n){t.data=X(n)},3:function(t,e,n){t.value=X(n)}};const J={mount(t){return this.value=this.evaluate(t),Q(this,this.value),this},update(t){const e=this.evaluate(t);return this.value!==e&&(Q(this,e),this.value=e),this},unmount(){return 1===this.type&&Q(this,null),this}};function Q(t,e){return Z[t.type](t.node,t,e,t.value)}function tt(t,e){return Object.assign({},J,e,{node:2===e.type?W(t,e.childNodeIndex):t})}const et=(t,e)=>t[_]||e,nt={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),K(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:s}=this.node,i=et(t,e);return this.template=n&&pt(n.html,n.bindings).createDOM(s),this.template&&(this.template.mount(this.node,this.getTemplateScope(t,i),i),this.template.children=Array.from(this.node.childNodes),rt(this.node)),r(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){const e=t&&t.firstChild;e&&(s(e,t),rt(t))}function st(t){return t.reduce(((t,e)=>{let{bindings:n}=e;return t.concat(n)}),[])}const it={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}):pt(function(t){return t.reduce(((t,e)=>t+e.html),"")}(e),[...st(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 ot={1:function(t,e){let{evaluate:n,template:i}=e;const o=document.createTextNode("");return s(o,t),r(t),Object.assign({},Y,{node:t,evaluate:n,placeholder:o,template:i.createDOM(t)})},2:function(t,e){let{expressions:n}=e;return Object.assign({},(r=n.map((e=>tt(t,e))),["mount","update","unmount"].reduce(((t,e)=>Object.assign({},t,{[e]:t=>r.map((n=>n[e](t)))&&s})),{})));var r,s},0:function(t,e){let{evaluate:n,condition:i,itemName:o,indexName:a,getKey:u,template:c}=e;const l=document.createTextNode(""),h=t.cloneNode();return s(l,t),r(t),Object.assign({},k,{childrenMap:new Map,node:t,root:h,condition:i,evaluate:n,isTemplateTag:U(h),template:c.createDOM(t),getKey:u,indexName:a,itemName:o,placeholder:l})},3:function(t,e){let{evaluate:n,getComponent:r,slots:s,attributes:i}=e;return Object.assign({},it,{node:t,evaluate:n,slots:s,attributes:i,getComponent:r})},4:function(t,e){let{name:n,attributes:r}=e;return Object.assign({},nt,{attributes:r,node:t,name:n})}};function at(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:s,redundantAttribute:i,expressions:o}=e,a=r?t.querySelector(r):t;i&&a.removeAttribute(i);const u=o||[];return(ot[s]||ot[2])(a,Object.assign({},e,{expressions:n&&!r?at(u,n):u}))}function ct(t,e){return C(t)?function(t,e){return e.ownerDocument.importNode((new window.DOMParser).parseFromString(`<svg xmlns="http://www.w3.org/2000/svg">${t}</svg>`,"application/xml").documentElement,!0)}(e,t):function(t,e){const n=U(e)?e:document.createElement("template");return n.innerHTML=t,n.content}(e,t)}function lt(t,n){switch(!0){case C(t):e(n,t);break;case U(t):t.parentNode.replaceChild(n,t);break;default:t.appendChild(n)}}const ht=Object.freeze({createDOM(t){return this.dom=this.dom||function(t,e){return e&&("string"==typeof e?ct(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:s,children:i,avoidDOMInjection:o}=r,{parentNode:a}=i?i[0]:t,u=U(t),c=u?Math.max(Array.from(a.childNodes).indexOf(t),0):null;return this.isTemplateTag=u,this.createDOM(t),this.dom&&(this.fragment=s||this.dom.cloneNode(!0)),this.el=this.isTemplateTag?a:t,this.children=this.isTemplateTag?i||Array.from(this.fragment.childNodes):null,!o&&this.fragment&<(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,s){if(this.el){switch(this.bindings.forEach((n=>n.unmount(t,e,s))),!0){case this.el[y]:break;case this.children&&null!==s:n(this.children);break;case!0===s:r(this.el);break;case null!==s:n(this.el.childNodes)}this.el=null}return this},clone(){return Object.assign({},this,{el:null})}});function pt(t,e){return void 0===e&&(e=[]),Object.assign({},ht,{html:t,bindingsData:e})}function dt(){return this}function mt(t){return P(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 bt(t,e,n){return Object.entries(e).forEach((e=>{let[r,s]=e;ft(t,r,s,n)})),t}function Ot(t,e){return Object.entries(e).forEach((e=>{let[n,r]=e;t[n]||(t[n]=r)})),t}function gt(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 Et(t,e){return gt("string"==typeof t?(e||document).querySelectorAll(t):t)}const vt=t=>1===t.length?t[0]:t;function Nt(t,e,n){const r="object"==typeof e?e:{[e]:n},s=Object.keys(r);return gt(t).forEach((t=>{s.forEach((e=>t.setAttribute(e,r[e])))})),t}function Tt(t,e){return function(t,e,n){const r="string"==typeof e?[e]:e;return vt(gt(t).map((t=>vt(r.map((e=>t[n](e)))))))}(t,e,"getAttribute")}const yt=new Map,_t=()=>Mt||(Nt(Mt=Et("style[riot]")[0]||document.createElement("style"),"type","text/css"),Mt.parentNode||document.head.appendChild(Mt),Mt);var Mt,jt={CSS_BY_NAME:yt,add(t,e){return yt.has(t)||(yt.set(t,e),this.inject()),this},inject(){return _t().innerHTML=[...yt.values()].join("\n"),this},remove(t){return yt.has(t)&&(yt.delete(t),this.inject()),this}};function xt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return(r=[...n,...r]).length<t.length?xt(t,...r):t(...r)}}function wt(t){return Tt(t,u)||t.tagName.toLowerCase()}const At=Object.freeze({$(t){return Et(t,this.root)[0]},$$(t){return Et(t,this.root)}}),St=Object.freeze({[c]:dt,[l]:dt,[h]:dt}),Ct=Object.freeze({[p]:dt,[d]:dt,[m]:dt,[f]:dt,[b]:dt,[O]:dt,[g]:dt}),Ut=Object.assign({},St,{clone:dt,createDOM:dt});function Pt(e,n){return void 0===n&&(n={}),Object.assign({},function(e){return Array.from(e.attributes).reduce(((e,n)=>(e[t(n.name)]=n.value,e)),{})}(e),mt(n))}const Lt=(t,e)=>t[o]=e;function Dt(t){return[c,l,h].reduce(((e,n)=>(e[n]=t(n),e)),{})}function It(t){let{css:e,template:n,exports:r,name:s}=t;const o=n?function(t,e){return t(pt,A,w,(t=>e[t]||i.get(t)))}(n,r?function(t){void 0===t&&(t={});return Object.entries(mt(t)).reduce(((t,e)=>{let[n,r]=e;
|
|
var s;return t[(s=n,s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())]=It(r),t}),{})}(r.components):{}):Ut;return t=>{let{slots:i,attributes:a,props:u}=t;if(r&&r[y])return function(t,e){let{slots:n,attributes:r,props:s,css:i,template:o}=e;o&&B("Pure components can not have html"),i&&B("Pure components do not have css");const a=Ot(t({slots:n,attributes:r,props:s}),St);return Dt((t=>function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(t===c){const[t]=n;t[y]=!0,Lt(t,a)}return a[t](...n),a}))}(r,{slots:i,attributes:a,props:u,css:e,template:n});const l=mt(r)||{},h=kt({css:e,template:o,componentAPI:l,name:s})({slots:i,attributes:a,props:u});return{mount:(t,e,n)=>h.mount(t,n,e),update:(t,e)=>h.update(e,t),unmount:t=>h.unmount(t)}}}function kt(t){let{css:e,template:n,componentAPI:r,name:s}=t;return e&&s&&jt.add(s,e),xt(Bt)(bt(Ot(r,Object.assign({},Ct,{[v]:{}})),Object.assign({[N]:null,[T]:null},At,{name:s,css:e,template:n})))}function Yt(t,e){return Object.assign({},t,mt(e))}function Bt(t,e){let{slots:n,attributes:r,props:s}=e;return i=function(t){return[...a].reduce(((t,e)=>e(t)||t),t)}(bt(Object.create(t),{mount(e,i,o){return void 0===i&&(i={}),this[M]=function(t,e){void 0===e&&(e=[]);const n=e.map((e=>tt(t,e))),r={};return Object.assign(r,Object.assign({expressions:n},Dt((t=>e=>(n.forEach((n=>n[t](e))),r)))))}(e,r).mount(o),ft(this,E,Object.freeze(Object.assign({},Pt(e,s),K(this[M].expressions)))),this.state=Yt(this.state,i),this[j]=this.template.createDOM(e).clone(),Lt(e,this),t.name&&function(t,e){wt(t)!==e&&Nt(t,u,e)}(e,t.name),ft(this,T,e),ft(this,N,n),this.onBeforeMount(this.props,this.state),this[_]=o,this[j].mount(e,this,o),this.onMounted(this.props,this.state),this},update(t,e){void 0===t&&(t={}),e&&(this[_]=e,this[M].update(e));const n=K(this[M].expressions);if(!1!==this.shouldUpdate(n,this.props))return ft(this,E,Object.freeze(Object.assign({},this.props,n))),this.state=Yt(this.state,t),this.onBeforeUpdate(this.props,this.state),this[j].update(this,this[_]),this.onUpdated(this.props,this.state),this},unmount(t){return this.onBeforeUnmount(this.props,this.state),this[M].unmount(),this[j].unmount(this,this[_],null===t?null:!t),this.onUnmounted(this.props,this.state),this}})),Object.keys(t).filter((e=>P(t[e]))).forEach((t=>{i[t]=i[t].bind(i)})),i;var i}const{DOM_COMPONENT_INSTANCE_PROPERTY:Kt,COMPONENTS_IMPLEMENTATION_MAP:Rt,PLUGINS_SET:Ht}=x;var $t,zt;!function(t,e){let{css:n,template:r,exports:s}=e;Rt.has(t)&&B(`The component "${t}" was already registered`),Rt.set(t,It({name:t,css:n,template:r,exports:s}))}("tiny-accordion",{css:null,exports:{state:{items:[],index:0},onBeforeMount(){this.content=this.root.innerHTML,this.root.innerHTML=""},onMounted(t,e){const n=this.$(".tiny-accordion__header");e.wrapper=document.createElement("div"),e.wrapper.innerHTML=this.content,n.after(e.wrapper);for(let t=0;t<e.wrapper.children.length;t++)e.items.push(e.wrapper.children[t].title),e.wrapper.children[t].classList.add("tiny-accordion__item"),0===t&&e.wrapper.children[t].classList.add("tiny-accordion__item--active");this.update()},handleClick(t,e){for(let t=0;t<this.state.wrapper.children.length;t++)this.state.wrapper.children[t].classList.remove("tiny-accordion__item--active"),t===e&&(this.state.wrapper.children[t].classList.add("tiny-accordion__item--active"),this.state.index=t);this.update()},getCurrentClass(t){let e=[];return t===this.state.index&&e.push("active"),e.join(" ")}},template:function(t,e,n,r){return t('<div class="tiny-accordion"><div class="tiny-accordion__header"><ul><li expr0="expr0"></li></ul></div></div>',[{type:n.EACH,getKey:null,condition:null,template:t(" ",[{expressions:[{type:e.TEXT,childNodeIndex:0,evaluate:function(t){return[t.item].join("")}},{type:e.ATTRIBUTE,name:"class",evaluate:function(t){return t.getCurrentClass(t.index)}},{type:e.EVENT,name:"onclick",evaluate:function(t){return()=>t.handleClick(t.event,t.index)}}]}]),redundantAttribute:"expr0",selector:"[expr0]",itemName:"item",indexName:"index",evaluate:function(t){return t.state.items}}])},name:"tiny-accordion"}),Et("tiny-accordion").map((t=>function(t,e,n){const r=n||wt(t);return i.has(r)||B(`The component named "${r}" was never registered`),i.get(r)({props:e}).mount(t)}(t,$t,zt)))},837:()=>{}},e={};function n(r){if(e[r])return e[r].exports;var s=e[r]={exports:{}};return t[r](s,s.exports,n),s.exports}n.m=t,n.x=t=>{},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={669:0},e=[[962],[837]],r=t=>{},s=(s,i)=>{for(var o,a,[u,c,l,h]=i,p=0,d=[];p<u.length;p++)a=u[p],n.o(t,a)&&t[a]&&d.push(t[a][0]),t[a]=0;for(o in c)n.o(c,o)&&(n.m[o]=c[o]);for(l&&l(n),s&&s(i);d.length;)d.shift()();return h&&e.push.apply(e,h),r()},i=self.webpackChunk_tentakelfabrik_tiny_accordion=self.webpackChunk_tentakelfabrik_tiny_accordion||[];function o(){for(var r,s=0;s<e.length;s++){for(var i=e[s],o=!0,a=1;a<i.length;a++){var u=i[a];0!==t[u]&&(o=!1)}o&&(e.splice(s--,1),r=n(n.s=i[0]))}return 0===e.length&&(n.x(),n.x=t=>{}),r}i.forEach(s.bind(null,0)),i.push=s.bind(null,i.push.bind(i));var a=n.x;n.x=()=>(n.x=a||(t=>{}),(r=o)())})(),n.x()})();
|